Angular 不是已知元素错误

标签 angular electron quill

我现在使用 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/

相关文章:

Angular 2 : Inserting capture element dynamically when creating components (dynamically)

electron - 在Windows上创建APPX包和DMG包

Python:将 Quill delta 转换为 HTML

javascript - 将 Observable<String[]> 转换为 Observable<DataType[]>

angular - 在 Angular 如何在 <td> 标签内使用 If .. then .. else 条件实现 *ngIf ?

javascript - 类型 'open' 上不存在属性 'MatDialogModule'

javascript - Electron 在页面上保存用户更改

javascript - 使用2种不同格式检测URL正则表达式

javascript - 使用 React.js 将富文本编辑器中的 HTML 标记保存到 MongoDB

reactjs - React-Quill - 错误你很可能想要 `editor.getContents()`