2017-10-29 13 views
1

私は現在角と電子を使用しています。角は既知の要素誤差ではありません

ngx-quillをモジュールファイルでインポートしました。

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

は、そして私は私のメインコンポーネントファイル

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

からQuillを輸入し、私は私のHTMLテンプレート

<quill-editor></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. 
+0

あなただけが 'AppModule'を持っているのでしょうか、あなた自身のコードに他のモジュールもありますか? –

+0

'ngx-quill-editor 'から' {QuillEditorModule}をインポートする; 'あなたのmain.moduleファイルでこれをインポートしてみてください。 – JefferinJoseph

+0

ありがとうございます。私は右のモジュールファイルに 'QuillModule'をインポートすることでこの問題を解決しました –

答えて

0
@NgModule({ 
imports: [ 
    QuillModule 
], 

は、実際にインポートされたモジュールのコンポーネントを使用するモジュールに追加する必要があります。
AppModuleまたはエディタコンポーネントを使用しているモジュールに直接インポートされていない他のモジュールでモジュールをインポートするだけでは不十分です。

関連する問題