我正在使用angular2我的問題是,我無法從javascript回調調用組件方法這裏是代碼段。如何從Javascript回調方法調用Typscript方法 - Angular2
declare var CORE_FACTORY:any;
// CORE_FACTORY Defined in javascript file which I've included in index.html and it's gets loded perfectly.
let coreApi = CORE_FACTORY.setupApiByDomain(Domain.QA);
coreApi.addUserEventListener(apiName, ApiEvent.ON_ANY_EVENT,this._userCallBack);
coreApi.callApi(request, this.afterCallApi);
afterCallApi(status, responceObject) {
this.postCreateInstrument(accountNumber); //Getting error right here.
}
public postCreateInstrument(accountNumber:string) {
alert('test');
}
它的所有的JavaScript到底;在瀏覽器解釋它之前,TypeScript會將其編譯(技術上,編譯)爲JavaScript。 –