You are on page 1of 1

ngModel and AppModules

Section 2, Lecture 27
In order to make ngModel work when using AppModules ( NgModule ), you have to
import FormsModule in your AppModule .

Like this:

1. import { NgModule } from '@angular/core';


2. import { BrowserModule } from '@angular/platform-browser';
3. import { FormsModule } from '@angular/forms';
4.
5. import { AppComponent } from './app.component';
6.
7.
8. @NgModule({
9. declarations: [AppComponent],
10. imports: [BrowserModule, FormsModule],
11. bootstrap: [AppComponent]
12. })
13. export class AppModule {}

You might also like