首页 > Web开发 > 详细

angular2 学习笔记 ( 第3方插件 jQuery and ckeditor )

时间:2017-03-07 08:35:19      阅读:1033      评论:0      收藏:0      [点我收藏+]

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 )

原文:http://www.cnblogs.com/keatkeat/p/6512673.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!