Używam PrimeNG & Angular2 dla mojej aplikacji.Angular2/PrimeNG - wyświetlanie Cant rozwijane
Mam komponent, który powinien pokazać rozwijane menu wybranych tematów. Śledziłem dokumentację PrimeNG Dropdown i o ile widzę, wszystko buduję w ten sam sposób. Ale ja zawsze otrzymuję błąd "Brak wartości accessor dla ''"
theme.component.ts:
import { Component, OnInit, Input } from '@angular/core'
import { Dropdown, SelectItem} from 'primeng/primeng';
@Component({
selector: 'my-themes',
templateUrl: 'dist/html/theme.component.html',
directives: [Dropdown],
})
export class ThemeComponent {
selectables: SelectItem[];
style: string;
constructor() {
this.selectables = [];
this.selectables.push({ label: 'Nightflat', value: 'Nightflat' });
this.selectables.push({ label: 'Flat', value: 'Flat' });
}
ngOnInit() {
}
}
theme.component.html:
<p-dropdown [options]="selectables" [(ngModel)]="style"></p-dropdown>
pomysłów gdzie problem może być? :( Edit: Problem actuallyy jest ngModel listy rozwijanej zostanie wyświetlona jeśli usunąć go ze znacznikiem html