標籤: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 )