Reputation: 892
So I am following this tutorial on how to implement a prime ng dropdown button: https://www.primefaces.org/primeng/showcase/#/dropdown
I followed the tutorial and the designed dropdown button is showing with value "New York". But when I click on it, nothing happens. I would expect it to dropdown and show me the other options, but nothing happens. I installed angular/cdk aswell.
my html:
<p-dropdown [options]="cities" [(ngModel)]="selectedCityCode" optionLabel="name" optionValue="code"></p-dropdown>
my ts (shortened):
interface City {
name: string,
code: string
}
cities: City[];
selectedCityCode: string;
constructor() {
this.cities = [
{name: 'New York', code: 'NY'},
{name: 'Rome', code: 'RM'},
{name: 'London', code: 'LDN'},
{name: 'Istanbul', code: 'IST'},
{name: 'Paris', code: 'PRS'}
];
}
What am I doing wrong?
Upvotes: 0
Views: 1853
Reputation: 892
Puh, this was funny. Apparently I had no import of BrowserAnimationsModule
in my module.ts. After import, everything worked.
Upvotes: 2