ngModel: No value accessor for ''

后端 未结 10 2237
暖寄归人
暖寄归人 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 16:11

    Try this

    import {FORM_DIRECTIVES} from '@angular/forms';
    

    Import any and all forms symbols - NgForm, Validators, etc - from @angular/forms. Importing them from @angular/common will result in a No value accessor found error.

提交回复
热议问题