ngModel: No value accessor for ''

后端 未结 10 2223
暖寄归人
暖寄归人 2020-12-09 15:08

I\'m creating a custom element in Angular 2.0 (), and when I include the ngModel attribute on the component, I\'m immediately hit with the foll

10条回答
  •  一整个雨季
    2020-12-09 15:52

    >=RC.5

    @NgModule({
      imports: [BrowserModule, FormsModule, ReativeFormsModule],
    

    FormsModule and/or ReativeFormsModule depending on whether you use template driven forms, model driven forms or both

    See also

    • https://angular.io/docs/ts/latest/guide/forms.html
    • https://angular.io/docs/ts/latest/cookbook/dynamic-form.html
    • http://blog.thoughtram.io/angular/2016/06/22/model-driven-forms-in-angular-2.html

提交回复
热议问题