fix(change_detection): pass the correct previous value when using pipes

Closes #588
This commit is contained in:
vsavkin
2015-02-20 16:23:16 -08:00
parent 1d4ffd986d
commit 7f31036427
2 changed files with 86 additions and 43 deletions

View File

@ -157,11 +157,11 @@ export class DynamicChangeDetector extends AbstractChangeDetector {
var newValue = pipe.transform(context);
if (! ChangeDetectionUtil.noChangeMarker(newValue)) {
var prevValue = this._readSelf(proto);
this._writeSelf(proto, newValue);
this._setChanged(proto, true);
if (proto.lastInBinding) {
var prevValue = this._readSelf(proto);
return ChangeDetectionUtil.simpleChange(prevValue, newValue);
} else {
return null;