ngModel: No value accessor for ''

后端 未结 10 2262
暖寄归人
暖寄归人 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:07

    In my case it was a simple typo error. The component's selector was 'my-component' but in the html I typed . Notice last three letters? Compiles just fine and then you have this 'no value accessor' error at runtime.

    From my experience you can have some other quite weird errors because of typos here and there. Typescript compiler doesn't care about markup.

提交回复
热议问题