0
votes

for using ngModel directive, I included

  • import { FormsModule } from '@angular/forms';
  • @NgModule({ imports: [ BrowserModule, FormsModule ], ... })

as mentioned here. But now I'm getting xhr error for loading @angular/forms from npmcdn (guess it won't be there) while using plunker. any idea on what to include in plunker ?

2
update working plunk in the question. related to stackoverflow.com/questions/38887044/… .candidJ

2 Answers

0
votes

Add to app.component.ts:

import { NgModel } from '@angular/forms'

and

providers: [NgModel],

to the @Component({...})

0
votes

Make sure to have 'forms' specified in ngPackageNames in config file

    var ngPackageNames = [
  'common',
  'compiler',
  'core',
  'forms',
  'http',
  'platform-browser',
  'platform-browser-dynamic',
  'router',
  'router-deprecated',
  'upgrade',
];