小编ksz*_*dev的帖子

如何将jquery和mCustomScrollbar插件导入Angular2组件

我有一个问题,将这些模块导入我的angular2组件.我使用AngularClass的angular2-webpack-starter.

我用npm安装dependecies:

npm install jquery --save
npm install malihu-custom-scrollbar-plugin --save
Run Code Online (Sandbox Code Playgroud)

并安装打字:

typings install jquery --save --ambient
typings install mcustomscrollbar --save --ambient
Run Code Online (Sandbox Code Playgroud)

我想在这样的组件中使用它:

jQuery('.selector').mCustomScrollbar();
Run Code Online (Sandbox Code Playgroud)

这样做的最佳解决方案是什么?

我尝试使用这个解决方案:什么是在角度2内使用jquery小部件的最佳方法?

但它不起作用,我得到错误"jQuery没有定义".

jquery mcustomscrollbar angular

3
推荐指数
1
解决办法
5178
查看次数

标签 统计

angular ×1

jquery ×1

mcustomscrollbar ×1