Search code examples
angularelectronquill

Angular not a known element error


I'm using Angular and Electron now.

I've imported ngx-quill through my module file.

@NgModule({
imports: [
    ~~~,
    QuillModule
],
exports: [RouterModule]
})

And I imported Quill from my main component file

import { QuillEditorComponent } from 'ngx-quill/src/quill-editor.component';
import Quill from 'quill';

And I used the quill-editor component within my html template

<quill-editor></quill-editor>

And I got an error like :

'quill-editor' is not a known element:
1. If 'quill-editor' is an Angular component, then verify that it is part of this module.
2. If 'quill-editor' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

Solution

  • @NgModule({
    imports: [
        QuillModule
    ],
    

    needs to be added to the module where you actually use components of the imported module.
    It is not enough to import the module in AppModule or some other module that is not imported directly into the module where you are using the editor component.