fix($parse): Handle one-time to null

Handles when a one-time binding stabilizes to `null`

Closes #7743
Closes #7787
This commit is contained in:
Lucas Galfaso
2014-06-11 16:11:48 +02:00
committed by rodyhaddad
parent 398053c563
commit 600a41a7b6
2 changed files with 13 additions and 2 deletions

View File

@@ -1055,7 +1055,8 @@ function $ParseProvider() {
if (oneTimeParseFn.$$unwatch && self && self.$$postDigestQueue) {
self.$$postDigestQueue.push(function () {
// create a copy if the value is defined and it is not a $sce value
if ((stable = isDefined(lastValue)) && !lastValue.$$unwrapTrustedValue) {
if ((stable = isDefined(lastValue)) &&
(lastValue === null || !lastValue.$$unwrapTrustedValue)) {
lastValue = copy(lastValue, null);
}
});