I have running the sample application to learn angular 2. In my sample application [(ngModel)]
is not working. But when i removes the square brackets (ngModel)
the screen is loading but two way binding is not working.
should i do anything for making [(ngModel)]
work.
Probably your code is missing this import line in your module:
import { FormsModule } from '@angular/forms';
You also have to add FormsModule to module imports array:
@NgModule({
imports: [FormsModule, /*...*/ ],
//...
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With