使用 ng2-ckeditor、Angular 4 时出现“缺少 CKEditor 4.x (http://ckeditor.com/)”警告

问题描述 投票:0回答:4

我将在我的 Angular 4 项目中使用 ng2-ckeditor 插件。 我阅读了指南,其中有 systemjs 文件的配置。 但我在我的 Angular 4 cli 项目中找不到 systemjs。 所以我做了指南中提到的除了 systemjs 配置之外的其他事情。 最后的结果是简单的文本框和警告

'CKEditor 4.x is missing (http://ckeditor.com/)'

这些都是我所做的。

1)    /*added this script to my component html file*/
<script src="https://cdn.ckeditor.com/4.5.11/full/ckeditor.js"></script>
2) 
npm install ng2-ckeditor
3) set appmodule
import { CKEditorModule } from 'ng2-ckeditor';

@NgModule({
  // ... 
  imports:      [
    CKEditorModule
  ],
  // ... 
})
export class AppModule { }

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

我想知道如何设置systemjs,即使我在项目中找不到systemjs文件 还有没有不设置这个的? 最好的问候

angular components
4个回答
13
投票

在你的index.html中导入脚本

<script src="https://cdn.ckeditor.com/4.6.1/full/ckeditor.js"></script>

1
投票

如果即使在导入@RahulSingh给定脚本后仍然有人面临问题,请使用

<script src="https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js"></script>
参考


0
投票

您可以尝试将您的DNS设置为Google公共DNS:8.8.8.8和8.8.4.4

之后,您可以转到浏览器,粘贴您的 DNS 地址并验证它是否打开...如果打开,请尝试使用 http 而不是 https 的相同地址(由于某些原因,只有在输入 http 地址后才有效) ..也许是巧合,但更好的保证)。

注意:始终保留带有 https 地址的 CDN。

更多信息:https://developers.google.com/speed/public-dns/docs/using


0
投票

最好将文件下载到本地并保存到 asset 文件夹中,并提供 index.html 文件的链接。

https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js

单击链接,它将打开一个脚本,将其保存在本地文件夹位置:asset

© www.soinside.com 2019 - 2024. All rights reserved.