Why (ngModel) is not working?

前端 未结 1 1081
借酒劲吻你
借酒劲吻你 2021-01-19 03:32

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 (ng

相关标签:
1条回答
  • 2021-01-19 04:17

    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, /*...*/ ],
       //...
    })
    
    0 讨论(0)
提交回复
热议问题