0

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 ?

1

2 Answers 2

0

Add to app.component.ts:

import { NgModel } from '@angular/forms'

and

providers: [NgModel],

to the @Component({...})

Sign up to request clarification or add additional context in comments.

1 Comment

we need not import NgModel as we are importing FormsModule in root component. same goes for providers
0

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',
];

1 Comment

can you look at the plunker i shared in question. it didn't help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.