我有以下打字稿代码:
export class Modal {
private link: Link;
constructor (public $link: JQuery) {
this.link = new Link($link);
this.ajaxGet(this.link);
}
ajaxGet(link: Link) {
$.ajax(link.Href,
{
context: {
link: link
},
dataType: 'html'
})
.done(this.ajaxDone)
.fail(this.ajaxFail);
}
ajaxDone(data: string, textStatus: string, jqXHR: JQueryXHR) {
var link = <Link> this.link;
link.Modal.Content = data;
this.create(link);
}
create(link: Link) {
var a = link;
}
}
这一直有效到在 ajaxDone 中我有一个 this.create(link)。问题是“this”不再是 Modal 并且它没有创建功能。此时如何让它调用 Modal.Create() 函数?