2017-09-27 48 views
1

我正在使用CkEditor Standard 4.7.3。我的代码不显示CkEditor,而是显示简单的TextArea。下面的代码我一直在使用。CKEditor未在角锅样板项目中显示

<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta charset="utf-8" /> 
    <title></title> 
    <script src="../../../node_modules/ckeditor/ckeditor.js"></script> 
    <script src="../../../node_modules/ckeditor/adapters/jquery.js"></script> 
    <script type="text/javascript"> 
     CKEDITOR.replace('myEditor'); 
    </script> 
</head> 
<body> 
    <div id="divMailBox"> 
     <span>Subject</span> 
<textarea class="ckeditor" id="myEditor" name="myEditor" cols="20" rows="10"><b>New Text can this be changed</b></textarea> 
    </div> 
</body> 
</html> 

请让我知道要添加什么

+0

您需要使用角度语法来显示角度应用程序中的编辑器 –

+0

不需要我找到答案并在下面添加 – Saravanan

回答

0

我已经找到了答案查看此网址 https://embed.plnkr.co/hnB0R3/

请按照下列步骤操作 1)安装包 NPM安装NG2-CKEditor的 - -SAVE

2)添加脚本index.html中

3)in app.module.ts adde below

import'CKEditorModule} from'ng2-ckeditor';

然后在进口部添加CKEditorModule部件

进口:

....../*一些部件*/

,CKEditorModule ],

4)然后在您的html页面中添加以下控件

<ckeditor [(ngModel)]="content" debounce="500"> 
<p>Hello <strong>world</strong></p> 
</ckeditor> 

5)运行并检查页面中的HTML编辑器。