angular/angular.dart — pull request #1013 by jbdeboer (2014-05-07 21:19:49+00:00)
Title: fix(compiler): OneWayOneTime bindings now wait for the model to stablize

BREAKING CHANGE

Previously, OneWayOneTime bindings would remove their watch after the
first value assignment. For models that take more than one digest loop
to stablize, this meant the OneWayOneTime bindings took a un-stablized
value.

With this change, these bindings will continue to accept value
assignments until their stablized value is non-null. The assignment may
occur multiple times.

Applications to depend on OneWayOneTime bindings being called exactly
once will break. The suggested upgrade path is to move the senstive
code into a domWrite callback. e.g. the old code:

@Decorator(
map: const { 'one-time': '=>!value' })
class OneTime {
set value(v) => onlyCalledOnce(v);
}

becomes

@Decorator(
map: const { 'one-time': '=>!value' })
class OneTime {
var _value;
set value(v) {
if (_value == null) {
scope.rootScope.domWrite(() => onlyCalledOnce(_value));
}
_value = v;
}
}

However, we expect that most uses of OneWayOneTime will be 'ok' with
being called a few times as the model stablizes.