私は学んTypeScriptでいて、次のクラスを持っています:
class DetailDriver {
public get driver() {
return super.getEntity();
}
public activate(): breeze.Promise {
var id = this.driver.id(); // this refers to (class) DetailDriver
return promise
.then(getCertificate)
.fail(somethingWrong);
function getCertificate() {
var id = this.driver.id(); // this refers to any
return ...
}
}
}
上記のコードでわかるように、最初の呼び出しthisは my class を参照していDetailDriverます。それは良い。this(inside getCertificate)への 2 番目の呼び出しは、 を参照しanyます。それは私が必要とするものではありません。クラスを参照する必要がありDetailDriverます。
どうやって進める?
ありがとう。