私はangular2
アプリケーションでprimeng
を使用しています。私は、テーブルビューのDataTable
を使用していると私は、私はエラーを取得していますHEREで説明したように...PrimeNG angular2のDataTableページ分割マルチセレクションの問題
エラーをcheckbox with paging
をしようとすると...
Unhandled Promise rejection: Template parse errors:
Can't bind to 'headerCheckboxToggleAllPages' since it isn't a known property of 'p-dataTable'.
1. If 'p-dataTable' is an Angular component and it has 'headerCheckboxToggleAllPages' input, then verify that it is part of this module.
2. If 'p-dataTable' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. [ERROR ->][headerCheckboxToggleAllPages]="true">
<p-col"): [email protected]:36 ; Zone: <root> ; Task: Promise.then ; Value: SyntaxError Error: Template parse errors:
は私がのために任意の特定のモジュールをインポートする必要がありますかこれはドキュメントが輸入品について言及していないので、私は同様の問題HEREを持っていて、モジュールをインポートした後にそれが機能しました。ここで
は私のview.htmlは...
<p-dataTable [value]="cars" [(selection)]="selectedCars3" [paginator]="true" [rows]="5" [headerCheckboxToggleAllPages]="true" sortMode="multiple" [selectionMode]="userRole=='user'? 'none' : 'single' ">
<p-header>Checkbox Multiple Selection with Paging</p-header>
<p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
<p-column field="vin" header="Vin"></p-column>
<p-column field="year" header="Year"></p-column>
<p-column field="brand" header="Brand"></p-column>
<p-column field="color" header="Color"></p-column>
<p-footer>
<ul>
<li *ngFor="let car of selectedCars3" style="text-align: left">{{car.vin + ' - ' + car.brand + ' - ' + car.year + ' - ' + car.color}}</li>
</ul>
</p-footer>
</p-dataTable>
と@NgModule.imports
imports: [
BrowserModule,
FormsModule,
ReactiveFormsModule,
HttpModule,
routing,
DropdownModule,
DataTableModule,
DialogModule,
ConfirmDialogModule,
ContextMenuModule,
PanelModule,
OverlayPanelModule,
PanelMenuModule,
GrowlModule,
FileUploadModule,
InputSwitchModule,
TreeTableModule,
SharedModule,
CalendarModule,
ClipboardModule,
CommonModule,
SpinnerModule.forRoot(),
TabViewModule,
AutoCompleteModule
]
マイpackage.json依存しているが...
"dependencies": {
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"primeng": "^2.0.1",
"rxjs": "^5.0.1"
}
私もPで試してみましたprimeng:4.1.0-rc.2
に同じ問題があります。提案してください。
4.1.0と同じエラー? – alehn96