我现在使用 Angular 和 Electron。
我已导入ngx-quill
通过我的模块文件。
@NgModule({
imports: [
~~~,
QuillModule
],
exports: [RouterModule]
})
我导入了Quill
来 self 的主要组件文件
import { QuillEditorComponent } from 'ngx-quill/src/quill-editor.component';
import Quill from 'quill';
我使用了quill-editor
我的 html 模板中的组件
<quill-editor></quill-editor>
我收到了如下错误:
'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.
最佳答案
@NgModule({
imports: [
QuillModule
],
需要添加到您实际使用导入模块的组件的模块中。
仅导入 AppModule
中的模块或未直接导入到您使用编辑器组件的模块中的其他模块是不够的。
关于 Angular 不是已知元素错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47002510/