ngx-tinymce-editor没有导出成员'NgxTinymceModule'

时间:2018-06-07 07:08:56

标签: javascript angular typescript angular-cli

我正在尝试将 ngx-tinymce-editor 实施到我的项目中,但这里似乎存在障碍。这是插件本身的错误,还是我在这里遗漏了一些东西。

ERROR in src/app/components/article/article-submit-form/article-submit-form.module.ts(4,10): error TS2305: Module '"*Project Path*/web/node_modules/ngx-tinymce-editor/ngx-tinymce-editor"' has no exported member 'NgxTinymceModule'

这就是我试图在其中包含tinymce编辑器的组件:

import { NgModule } from "@angular/core";
import { ArticleSubmitFormComponent } from "./article-submit-form.component";
import { SharedModule } from "../../shared/shared.module";
import { NgxTinymceModule } from "ngx-tinymce-editor";

@NgModule({
    imports: [SharedModule, NgxTinymceModule.forRoot()],
    declarations: [ArticleSubmitFormComponent],
    exports: [ArticleSubmitFormComponent]
})
export class ArticleSubmitFormModule {}

我甚至尝试将其模块包含在app.module.ts中,但到目前为止没有任何事情发生。

我正在使用默认选择器:

<ngx-tinymce-editor [(content)]="content"></ngx-tinymce-editor>

我收到以下错误:

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

{ "resource": "/d:/Projects/dev/SXNM-PROD/web/src/app/app.component.html", "owner": "_generated_diagnostic_collection_name_#1", "code": "undefined", "severity": 8, "message": "Can't bind to 'content' since it isn't a known property of 'ngx-tinymce-editor'.\n1. If 'ngx-tinymce-editor' is an Angular component and it has 'content' input, then verify that it is part of this module.\n2. If 'ngx-tinymce-editor' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.\n3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.", "source": "Angular", "startLineNumber": 54, "startColumn": 21, "endLineNumber": 54, "endColumn": 42 }

但是我的组件中添加了content = ``;属性需要tinymce。

1 个答案:

答案 0 :(得分:1)

该模块被称为&#34; NgxTinymceEditorModule&#34;。尝试导入它,文档似乎显示错误的名称。

import { NgxTinymceEditorModule } from "ngx-tinymce-editor";

imports: [SharedModule, NgxTinymceEditorModule.forRoot()],