Primeng 14.1.2 doesn't show toggle button even after import, no errors on console

60 Views Asked by At

My module declaration is like this

import { CUSTOM_ELEMENTS_SCHEMA, NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import {InplaceModule} from 'primeng/inplace';
import { ResultadoImoveisResidenciaisVendaRoutingModule } from './resultado-imoveis-residenciais-venda-routing.module';
import { FormsModule } from '@angular/forms';
import { CoreModule } from 'src/app/core/core.module';
import { DropdownModule } from 'primeng/dropdown';
import {ToggleButtonModule} from 'primeng/togglebutton';

@NgModule({
  declarations: [],
  imports: [
    CommonModule,
    ResultadoImoveisResidenciaisVendaRoutingModule,
    InplaceModule,
    FormsModule,
    CoreModule,
    DropdownModule,
    ToggleButtonModule
  ]

})
export class ResultadoImoveisResidenciaisVendaModule { }

My template is like this

             <p-toggleButton [(ngModel)]="val"></p-toggleButton>        

Nothings appears. If someone can help.

1

There are 1 best solutions below

0
On

I am bulding a portfolio, I chose PrimeNg because I learned about it on my last job. I thought it very suitable for to style a website to show off to someone else. It's so frustrating that sometimes third party libraries let you down, I would have to use bootstrap or a custom pager that would break my layout design, as I was counting on putting it afterwards after styling other aspects of the page. Fortunatelly I found the solution

**We have to import it on the app module and on the feature module that you are working on, both places!.

I am "playing" with this project for

years and I forgot about it because I had some time since I last worked with it