MdCheckBox - error when [(ngModel)] on md-checkbox inside ngFor
<tr *ngFor="let alarm of alarms">
<md-checkbox [(ngModel)]="alarm.isActive"></md-checkbox>
</tr>
throws an error in the console:
"Uncaught (in promise): TypeError: Cannot set property 'stack' of undefined TypeError: Cannot set property 'stack' of undefined at SyntaxError.set [as stack] (eval at
(file:///C:/projects/school/dist/vendor.js:17:2), :1628:63) at assignAll (eval at (file:///C:/projects/school/dist/polyfills.js:1744:2), :704:29) at SyntaxError.ZoneAwareError (eval at (file:///C:/projects/school/dist/polyfills.js:1744:2), :775:16) at SyntaxError.BaseError [as constructor] (eval at (file:///C:/projects/school/dist/vendor.js:17:2), :1590:18) at new SyntaxError (eval at (file:///C:/projects/school/dist/vendor.js:17:2), :1793:18) at TemplateParser.parse (eval at (file:///C:/projects/school/dist/vendor.js:17:2), :11210:21) at JitCompiler._compileTemplate (eval at (file:///C:/projects/school/dist/vendor.js:17:2), :27480:70) at eval (eval at (file:///C:/projects/school/dist/vendor.js:17:2), :27363:64) at Set.forEach (native) at JitCompiler._compileComponents (eval at (file:///C:/projects/school/dist/vendor.js:17:2), :27363:21) at createResult (eval at (file:///C:/projects/school/dist/vendor.js:17:2), :27246:21) at ZoneDelegate.invoke (eval at (file:///C:/projects/school/dist/polyfills.js:1744:2), :242:26) at Zone.run (eval at (file:///C:/projects/school/dist/polyfills.js:1744:2), :113:43) at eval (eval at (file:///C:/projects/school/dist/polyfills.js:1744:2), :535:57) at ZoneDelegate.invokeTask (eval at (file:///C:/projects/school/dist/polyfills.js:1744:2), :275:35) at Zone.runTask (eval at (file:///C:/projects/school/dist/polyfills.js:1744:2), :151:47) at drainMicroTaskQueue (eval at (file:///C:/projects/school/dist/polyfills.js:1744:2), :433:35)"
Looks like an error with [email protected] (see: https://github.com/angular/angular/search?q=zone.js+0.7.5&type=Issues)
npm install [email protected] resolved similar issue for me
then it would throw the following error
(program):405 Unhandled Promise rejection: Template parse errors: Can't bind to 'ngModel' since it isn't a known property of 'md-checkbox'.
- If 'md-checkbox' is an Angular component and it has 'ngModel' input, then verify that it is part of this module.
- If 'md-checkbox' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message.
Seems to work for me: http://plnkr.co/edit/AcJc12SViI5VGKMyLgVj?p=preview
my mistake. forgot FormsModule ..
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.