angular2 rc.5 custom input, No value accessor for form control with unspecified name
adding ngDefaultControl to the custom input component in the host solved the issue, thanks @danieleds
Add ngDefaultControl to the custom-input component. This adds two-way databinding, you shouldn't have to implement the value accessor methods unless you are doing something unique.
<custom-input name="firstName" [(ngModel)]="firstName" ngDefaultControl></custom-input>
Add ngDefaultControl
to your input. eg
<inline-editor type="textarea" [(ngModel)]="editableTextArea" (onSave)="saveEditable($event)" value="valor" ngDefaultControl> </inline-editor>
Then import { FORM_DIRECTIVES } from '@angular/common'
;
Finally directives: [FORM_DIRECTIVES]
This will work :) Thanks for the above comments
I was putting [(ngModel)]
on my <option>
tag instead of <select>
So yeah... that will cause this.