DataTable broken with rc.5
Hello,
it seems like DataTable and some others are broken with rc.5 After the update among others i got the following error:
zone.js:461 Unhandled Promise rejection: Template parse errors:
Can't bind to 'ngStyle' since it isn't a known property of 'div'. ("<div [ERROR ->][ngStyle]="style" [class]="styleClass" [ngClass]="{'ui-datatable ui-widget': true, 'ui-d"): DataTable@1:13
My packages.json:
"dependencies": {
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/forms": "0.3.0",
"@angular/http": "2.0.0-rc.5",
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/router": "3.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.5",
"systemjs": "0.19.36",
"core-js": "^2.4.0",
"es6-shim": "^0.35.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"rxjs-es": "^5.0.0-beta.6",
"zone.js": "^0.6.12",
"angular2-in-memory-web-api": "0.0.15",
"primeng": "1.0.0-beta.12",
"primeui": "^4.1.14"
},
Is it really broken or can i fix it by changing the compiler? There was a note in rc.5 release docs, but i didn't really got the point yet :-(
I can get DataTable to work on RC5 within a module but cannot get it to work from a shared module. In my case the error is:
Can't bind to 'ngModel' since it isn't a known property of 'input'. (" <input type="text" class="ui-cell-editor ui-state-highlight" *ngIf="col.editable" [ERROR ->][(ngModel)]="rowData[col.field]" (blur)="switchCellToView"): DataTable@60:118
TabMenu, Dialog, Button, InputText, Dropdown, Header, Footer, Messages are all working fine from the same shared module, its just DataTable that I'm having the issue with.
That is a good hint.
I used DataTable via
@ngModule({
imports: [
wfmRouting
],
declarations: [
WfmComponent,
DefinedProcessesComponent,
RunningProcessesComponent,
FinishedProcessesComponent,
ConfigurationComponent,
Button, Column, DataTable, Dialog, Footer, Header, InputText,
TieredMenu,
ItsPageTitleComponent
]
});
export class WfmModule {
}
where "Wfm" is an application with several subpages. The error is happening in "ConfigrationComponent".
I figured it out. The problem was I was not importing FormsModule into my shared module. Corrected that and BAM!
@NgModule({ imports: [ CommonModule, FormsModule // DataTable needs this ], declarations: [ TabMenu, Dialog, Button, InputText, Dropdown, Header, Footer, Messages, DataTable, Column ], exports: [ TabMenu, Dialog, Button, InputText, Dropdown, Header, Footer, Messages, DataTable, Column ] })