Closed dmitriytretyakov closed 4 years ago
I try to add editor to my template with code: <ngx-editorjs-mat-field [formControlName]="field.field">
Angular showing error in runtime:
ERROR Error: No value accessor for form control with name: 'description' at _throwError (forms.js:2862) at setUpControl (forms.js:2688) at FormGroupDirective.addControl (forms.js:6568) at FormControlName._setUpControl (forms.js:7293) at FormControlName.ngOnChanges (forms.js:7216) at FormControlName.wrapOnChangesHook_inPreviousChangesStorage (core.js:18239)
and
ERROR Error: mat-form-field must contain a MatFormFieldControl. at getMatFormFieldMissingControlError (form-field.js:284) at MatFormField._validateControlChild (form-field.js:876) at MatFormField.ngAfterContentInit (form-field.js:605) at callHook (core.js:4847) at callHooks (core.js:4811) at executeHooks (core.js:4762) at refreshDescendantViews (core.js:11582) at renderEmbeddedTemplate (core.js:11922) at refreshDynamicEmbeddedViews (core.js:13073) at refreshDescendantViews (core.js:11578)
Your component implement ControlValueAccessor? https://stackoverflow.com/questions/45659742/angular4-no-value-accessor-for-form-control
Trying to pass @Input holder value, but get error: core.js:7187 ERROR Error: Template error: Can't bind to 'holder' since it isn't a known property of 'ngx-editorjs-mat-field'. at createUnknownPropertyError (core.js:12544) at validateAgainstUnknownProperties (core.js:12483) at elementPropertyInternal (core.js:12389) at Module.ɵɵproperty (core.js:16542) at ControlGroupComponent_ng_container_1_mat_form_field_5_Template (control-group.component.html:13) at executeTemplate (core.js:11982) at renderEmbeddedTemplate (core.js:11916) at refreshDynamicEmbeddedViews (core.js:13073) at refreshDescendantViews (core.js:11578) at renderEmbeddedTemplate (core.js:11922)
Why?
Looks like there might be an issue in the editorjs-mat-field.component.ts
I added:
if (this.ngControl) { this.ngControl.valueAccessor = this; }
to the constructor.
The demo has an typo on the material-form-field.component.html
formCotrolName="pageEditor"
should be
formControlName="pageEditor"
Link https://github.com/tanepiper/ngx-tinynodes/blob/master/libs/ngx-editorjs/README.md and many others return 404 error, how to correct use editor component?