我正在尝试使用typescript中jquery插件中的方法。 我在index.html中包含了这些插件。任何人都可以帮我从typescript中调用插件方法。
来源:
//plugin
import {Component} from '@angular/core';
//import * from '../../../assets/js/query-builder/query-builder"
declare var $ : any;
@Component({
selector: 'rule',
template: ` <script src="assets/js/query-builder/query-builder.js"></script><div id="Query"> <query-builder class="margin30" [data]="query" [config]="config"></query-builder>
<div class="margin30">
<textarea >{{query | json}}</textarea>
<button md-raised-button type="button" color="primary" name="and" (click)="OnANDClick()">AND</button>
</div> </div>`
})
export class RSComponent{
//Builded query codes
OnANDClick(){
var query = $("#Query");
//$.getSQL("string", '\n', this.query)
//var resSql = query.getSQL("string", '\n', this.query);
//var sqlParsed = resSql.sql;
// console.log(sqlParsed);
}
}
提前致谢