私のアプリには、PrimeNG & Angular2が使用されています。Angular2/PrimeNG - カント表示ドロップダウン
私には、選択可能なテーマのドロップダウンメニューが表示されるはずのコンポーネントがあります。 私はPrimeNG Dropdownのドキュメンテーションを辿ってきましたが、私が見る限り、すべてが同じように構築されています。
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>
任意のアイデアしかし、私は常にエラー " '' なし値アクセサに"
theme.component.tsを取得しています問題はありますか? :( 編集:問題のactuallyyはngModelである私はhtmlタグから削除する場合はドロップダウンが表示されます