refactor(PromisePipe): use lexical this inside of transform

This commit is contained in:
Jeff Cross 2015-05-12 10:43:56 -07:00
parent c8a0ed40bd
commit 96b0a1c75e

View File

@ -53,12 +53,11 @@ export class PromisePipe extends Pipe {
} }
transform(promise: Promise<any>): any { transform(promise: Promise<any>): any {
var pipe = this;
if (isBlank(this._sourcePromise)) { if (isBlank(this._sourcePromise)) {
this._sourcePromise = promise; this._sourcePromise = promise;
promise.then((val) => { promise.then((val) => {
if (pipe._sourcePromise === promise) { if (this._sourcePromise === promise) {
pipe._updateLatestValue(val); this._updateLatestValue(val);
} }
}); });
return null; return null;