问题
This is my first question, I'm using angular2.beta.8, polymer 1.0, typescript. I'm having a problem when I use ngModel data binding with polymer paper-input element
Basically nothing more than an element with ngModel and variable in the class. Running that creates this error: No value accessor for ''
I started to use polymers with angular 2 just recently, and maybe this is noobie question, but I can't seem to find any information covering this topic.
I have searched for this error for quite some while and I feel like I have no options left other than ask you guys.
回答1:
You need to add ngDefaultControl
<paper-input [(ngModel)]="myModel" ngDefaultControl></paper-input>
See also https://github.com/angular/angular/issues/5360
来源:https://stackoverflow.com/questions/35867952/how-to-use-angular2-ngmodel-for-polymer-paper-input-error-no-value-accessor-fo