Issue
I'm having big troubles with angular form value accessor. The error is the following : "No value accessor for form control with name: 'textTitle'" from SectionComponent.ngfactory.js I'm using an angular lib called ContentEditable that implements ControlValueAccessor to set text to editable and link it to a form.
Here is my reactive form :
this.form = new FormGroup({
descriptionText : new FormControl(this.descriptionText),
textTitle: new FormControl(this.titleText),
buttonText : new FormControl(this.buttonText)
})
Here is one of the editable content :
<form [formGroup]="form">
<div class="descriptionSectionBlock title" [ngStyle]='{ }'
*ngIf="currentSection.titleText.textDisplayed" >
<div [ngStyle]='{ }'>
<h2 contentEditable="true" formControlName="textTitle"
(blur)="updateTextContent('title')"
[ngStyle]='{ }'>
{{titleText}}
</h2>
</div>
</div>
<div class="descriptionSectionBlock description" [ngStyle]='{ }'
*ngIf="currentSection.descriptionText.textDisplayed" >
<div [ngStyle]='{ }'>
<p contentEditable="true" formControlName="descriptionText"
(blur)="updateTextContent('description')"
[ngStyle]='{ }'>
{{descriptionText}}
</p>
</div>
</div>
<div [ngStyle]='{ }' class="descriptionSectionBlock button"
*ngIf="currentSection.CTAButtonDisplay">
<button contentEditable="true" formControlName="buttonText" (mouseover)="hover=true" (mouseleave)="hover=false"
(blur)="updateTextContent('button')"
[ngStyle]='{
}' mat-raised-button>
{{buttonText}}
</button>
</div>
</form>
I don't understand what i did wrong. Thanks for helping.
Solution
It was because i used the contentEditable property and not the contenteditable one...
I love this kind of error description...
Answered By - Julien FEGER
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.