angular还有人用吗 如何在Angular2中使用jquery?

如何在Angular2中使用jquery?在angular2中使用jQuery方法:首先索引.htmljQuery文件在中介绍,后面是HTTPS的定义:import{component,element

如何在Angular2中使用jquery?

在angular2中使用jQuery方法:首先索引.htmljQuery文件在中介绍,后面是HTTPS的定义:import{component,elementref,OnInit}from “@angular/core”declare varjQuery:any//定义jquery@组件({template:`})导出类TestComponent实现OnInit{构造函数(public{elementRef:ElementRef){}ngOnInit():任何{jQuery(this.元素参考nativeElement).on(“click”,function(){控制台.log(123)}jQuery也可以更改为$符号