84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
如何在angular2里面使用jquery等插件比如:class MyComponent {
constructor() { // how to query the DOM element from here? }
}虽然看过几个答案,但是没看明白,自己动手也都失败了,求教
认证高级PHP讲师
First install jquery
tsd install jquery --save
or
typings install dt~jquery --global --save
Write in the header of the ts file you need to use
declare var $: any;
This way you can use jquery in your ts file
Like it, but it is not recommended to use Jquery in angular2, it is easy to be contaminated
ng2 Don’t use jquery, there is no needIf you pass the dom, just specify it #content in the template
#content
First install jquery
or
Write in the header of the ts file you need to use
This way you can use jquery in your ts file
Like it, but it is not recommended to use Jquery in angular2, it is easy to be contaminated
ng2 Don’t use jquery, there is no need
If you pass the dom, just specify it
#content
in the template