标签:npm from pre cli copy com edit index set
refer :
https://forums.meteor.com/t/importing-ckeditor-using-npm/28919/2 (ckeditor)
https://github.com/angular/angular-cli/issues/3094 (jQuery)
Ckeditor
1. npm install ckeditor --save
2. npm install @types/ckeditor --save --dev
3. index.html 写上
<script>
CKEDITOR_BASEPATH = ‘/app/ckeditor/‘;
</script>
4. 创建一个 /app/ckeditor 文档
从 node_modules/ckeditor 里面把几个文件 copy 去 /app/ckeditor 里 (lang, plugins, skins, config.js, contents.css, styles.js )
5. import "ckeditor";
6.
ngAfterViewInit() { setTimeout(() => { CKEDITOR.replace( ‘editor1‘ ); }); }
jQuery
1. npm install jquery --save
2. npm install @type/jquery --save --dev
3. import $ from ‘jquery/dist/jquery‘;
4. declare var $:JQueryStatic;
5.
ngAfterViewInit() { setTimeout(() => { $("div").show(); }); }
angular2 学习笔记 ( 第3方插件 jQuery and ckeditor )
标签:npm from pre cli copy com edit index set
原文地址:http://www.cnblogs.com/keatkeat/p/6512673.html