我有一个将这些模块导入到我的angular2组件的问题。我使用AngularClass的angular2-webpack-starter。如何将jquery和mCustomScrollbar插件导入到Angular2组件
我安装依赖条件与NPM:
npm install jquery --save
npm install malihu-custom-scrollbar-plugin --save
并安装分型:
typings install jquery --save --ambient
typings install mcustomscrollbar --save --ambient
,我想用它组成是这样的:
jQuery('.selector').mCustomScrollbar();
什么是最好的解决方案做到这一点?
我试图用这个解决方案:Whats the best way to use jquery widgets inside angular 2?
但它不工作,我得到了错误“ jQuery是没有定义”。
嘿谢谢,这样一个结构良好的答案。我已经学到了很多这种形式! –
感谢您的好朋友! –