angular 4使用jquery 第三方插件库

用jBox插件为例子1,npm install jBox --save2,找到.angular-cli.json 增长"../node_modules/jbox/Source/jBox.min.js"3,找到style.scss 增长@import "../node_modules/jbox/Source/jBox.css";4,在组件中写入declare var $: any;$jBox: any;clickAler…css

 

 

用jBox插件为例子node

1,npm install jBox --savenpm

2,找到.angular-cli.json  增长json

"../node_modules/jbox/Source/jBox.min.js"

3,找到style.scss 增长this

@import "../node_modules/jbox/Source/jBox.css";

 

4,在组件中写入插件

declare var $: any;ip


$jBox: any;
clickAlert() {

this.myModal = this.$jBox.jBox('Tooltip', {
attach: '.tooltip',
trigger: 'click'
});
this.myModal.open();
}
ngAfterViewInit() {
this.$jBox = $(this.el.nativeElement);
}

ok jBox插件就能在 angular 4 中使用了 scss

相关文章
相关标签/搜索