84669 Lernen von Personen
152542 Lernen von Personen
20005 Lernen von Personen
5487 Lernen von Personen
7821 Lernen von Personen
359900 Lernen von Personen
3350 Lernen von Personen
180660 Lernen von Personen
48569 Lernen von Personen
18603 Lernen von Personen
40936 Lernen von Personen
1549 Lernen von Personen
1183 Lernen von Personen
32909 Lernen von Personen
如何在angular2里面使用jquery等插件比如:class MyComponent {
constructor() { // how to query the DOM element from here? }
}虽然看过几个答案,但是没看明白,自己动手也都失败了,求教
认证高级PHP讲师
首先安装jquery
tsd install jquery --save
或者
typings install dt~jquery --global --save
在需要使用的ts文件头部中写
declare var $: any;
这样在你的该 ts 文件中就可以使用jquery了
赞一个,不过angular2中应该不建议使用Jquery,容易被污染
ng2 就不要使用 jquery 了,没必要传 dom 的话直接在 template 指定 #content 就行
#content
首先安装jquery
或者
在需要使用的ts文件头部中写
这样在你的该 ts 文件中就可以使用jquery了
赞一个,不过angular2中应该不建议使用Jquery,容易被污染
ng2 就不要使用 jquery 了,没必要
传 dom 的话直接在 template 指定
#content
就行