请不要将此问题标记为重复,因为stackoverflow上提供的解决方案都无法解决我的问题,
我正在尝试将ng2-ckeditor ckeditor集成到现有的angular 4项目中。
我试图按照这里描述的步骤进行,但没有成功。我在git和stackoverflow上找到了不同的讨论,但对我没有用。
我按以下步骤进行:
在我的索引文件中引用了以下js文件。
在我的 app.module.ts 中导入模块。
但是当我尝试在我的应用程序中使用 ckeditor 代码时
当我运行ng serve命令时,编译成功,但没有显示任何内容,并出现以下控制台错误。
任何帮助将不胜感激。
我按以下步骤进行:
在我的索引文件中引用了以下js文件。
1 <script src="https://cdn.ckeditor.com/4.5.11/full/ckeditor.js"></script>
2 <script src="config.js"></script>
在我的 app.module.ts 中导入模块。
import{CKEditorModule} from "ng2-ckeditor";
.
.
.;
imports: [
BrowserModule,
AppRoutingModule,
.
.
.,
CKEditorModule,
],
但是当我尝试在我的应用程序中使用 ckeditor 代码时
<ckeditor [(ngModel)]="description" > </ckeditor>
它被标记为未知元素,并且我收到以下文本提示
[Angular]
'ckeditor' is not a known element:
1. If 'ckeditor' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.
当我运行ng serve命令时,编译成功,但没有显示任何内容,并出现以下控制台错误。
Uncaught Error: Template parse errors:
'ckeditor' is not a known element:
1. If 'ckeditor' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("N' | translate:lang }}</span>
<div formControlName="description" [froalaEditor] ></div>
[ERROR ->]<ckeditor></ckeditor>
</mat-card-content>
</mat-card>
任何帮助将不胜感激。