kolkov / angular-editor

A simple native WYSIWYG editor component for Angular 6 -14+
https://angular-editor.kolkov.ru
MIT License
673 stars 356 forks source link

Error: Can't bind to 'config' since it isn't a known property of 'angular-editor'. #404

Open syahirudean opened 3 years ago

syahirudean commented 3 years ago

Hi, I've imported the { AngularEditorModule } module and to my app.module and imported the { AngularEditorConfig } into my component as the guide. But Ithis error keeps poping.

`ERROR in projects/sg-math/src/app/features/question/ask/ask.component.html:14:43 - error NG8002: Can't bind to 'config' since it isn't a known property of 'angular-editor'.

  1. If 'angular-editor' is an Angular component and it has 'config' input, then verify that it is part of this module.
  2. If 'angular-editor' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

    14 <angular-editor [(ngModel)]="htmlContent" [config]="config">

    
      projects/sg-math/src/app/features/question/ask/ask.component.ts:6:16
        6   templateUrl: './ask.component.html',
    Error occurs in the template of component AskComponent.`
Gaugeforever commented 2 years ago

I have the most recent version and cannot verify this. Not only that, you can see in the code on github here that the input does exist.

@Input() config: AngularEditorConfig = angularEditorConfig;

So this must be an issue on your end.

ChipClark commented 2 years ago

I am trying to put this editor into my project.

page.ts

...
import { AngularEditorModule } from '@kolkov/angular-editor';
import { AngularEditorConfig } from '@kolkov/angular-editor';
...
editorConfig: AngularEditorConfig = {
    editable: true,
    spellcheck: true,
    minHeight: '5rem',
    maxHeight: '75rem',
    translate: 'no',
    sanitize: false,
    defaultFontName: 'Verdana',
    defaultFontSize: '12',
    defaultParagraphSeparator: 'p',
  };

  @Input() config: AngularEditorConfig = this.editorConfig;

page.html

  <angular-editor name="SidebarContent" [(ngModel)]="SidebarContent" [config]="editorConfig" ></angular-editor>

I'm getting the same error.

rherrera94 commented 2 years ago

I have te same error and i solved..

Import angular-editor module

import { HttpClientModule} from '@angular/common/http'; import { AngularEditorModule } from '@kolkov/angular-editor';

@NgModule({ imports: [ HttpClientModule, AngularEditorModule ] })

dentro del app.module.ts tenes que importar import { HttpClientModule} from '@angular/common/http'; import { AngularEditorModule } from '@kolkov/angular-editor'; y ademas agregar a los imports dentro del NgModule HttpClientModule, AngularEditorModule

rherrera94 commented 2 years ago

https://github.com/kolkov/angular-editor#readme you have to read te part of usage