I migrated to PrimeNG 6.1.7 and I've a problem with p-dropdown. This is my code import in app.module (taken from a simple example):
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {DropdownModule} from 'primeng/dropdown'; // include this for dropdown support
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
DropdownModule // dropdown support
],
providers: [],
bootstrap: [AppComponent],
schemas:
[]
})
export class AppModule { }
In app.component.ts:
import { Component, OnInit } from '@angular/core';
import {SelectItem} from 'primeng/api';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit{
employes: SelectItem[];
selectedEmploye: any;
constructor(){
this.employes = [
{label:'Select Employee', value:null},
{label:'Franc', value:1},
{label:'Kiran', value:2},
{label:'John', value:3},
];
}
ngOnInit(){
}
}
And in html I've:
<p-dropdown employes="" ngmodel="" options="" selectedemploye=""></p-dropdown>
Selected Employee: {{selectedEmploye }}
I also installed primeicons e imported it in angular.json:
...
"styles": [
"src/styles.css",
"node_modules/primeicons/primeicons.css"
],
...
Dropdown is not correctly showed:
Any suggestion? Very thanks...