如何在打字稿中從單獨的嵌入式函數內擊中某個函數?嵌套方法中的命中方法
我試圖完成什麼...在僞;
export class blah {
functionOne(result) {
// do stuff with the result of functionTwoChildMethod...
};
const geocoder = new google.maps.Geocoder();
geocoder.geocode (paramObj, function (res, stat) {
functionTwoChildMethod =() => {
this.functionOne(result);
};
};
};
似乎做this.functionOne(result);
沒有達到類範圍的母體火過functionOne什麼的。那麼我錯過了什麼?感謝您的任何方向這已經困擾了我的時間比我願意分享:)
HA!是的......那不是我會猜到的邏輯!非常感謝!如果我也可以upvote,但我會,但我的代表太低了,但你要麼我的感謝! :) – LearningNewStuff
別擔心,我只是高興地幫助:) –