Я пытаюсь внедрить ngx-tinymce-редактор в свой проект, но, похоже, здесь есть препятствие. Это ошибка самого плагина, или мне что-то здесь не хватает.
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.
Да. С необязательной опцией --save
(сохранение автоматически добавляется в новых версиях npm)



![Безумие обратных вызовов в javascript [JS]](https://i.imgur.com/WsjO6zJb.png)


Этот модуль называется «NgxTinymceEditorModule». Попробуйте импортировать это, в документах отображается неправильное имя.
import { NgxTinymceEditorModule } from "ngx-tinymce-editor";
а также
imports: [SharedModule, NgxTinymceEditorModule.forRoot()],
Теперь я получаю следующую ошибку: ERROR ReferenceError: tinymce is not defined at NgxTinymceComponent.push../node_modules/ngx-tinymce-editor/fesm5/ngx-tinymce-editor.js.NgxTinymceComponent.ngAfterViewInit (ngx-tinymce-editor.js:52).
Насколько я понимаю, компонент сам по себе не импортирует tinymce. Вам, вероятно, придется импортировать его самостоятельно.
Я сделал, как вы предложили в своем ответе.
Мой ответ показывает только импорт компонента. Компоненту также нужна библиотека tinymce для работы. Взгляните на этот tinymce.com/docs/advanced/usage-with-module-loaders, чтобы импортировать сам tinymce
Вы тоже запускали
npm i tinymce?