-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Two-way bound attribute watcher not appearing dirty when it should #9821
Comments
it looks like a real bug |
When using `$parse` with a stateful interceptor and the expression is `undefined`, then return the result from the interceptor Closes angular#9821
When using `$parse` with a stateful interceptor and the expression is `undefined`, then return the result from the interceptor Closes angular#9821
When using `$parse` with a stateful interceptor and the expression is `undefined`, then return the result from the interceptor Closes angular#9821
@lgalfaso this bug is bogus. The issue is that in the reproduction, the wrong attribute name is used in the binding outside of the isolate scope |
--- actually, I'm half-wrong. The repro is bogus, but it is still slightly broken, I just didn't notice =) |
@caitp in the parent scope, there is a watcher |
The reason why that wouldn't work is because the controller (and watch) is instantiated (and run) first, and we aren't going back to re-check it. It fails with the other case as well, which is the problem. |
@caitp you are right, this is still an issue without the second external watch as in http://jsfiddle.net/8c2qekz4/ |
When using `$parse` with a stateful interceptor and the expression is `undefined`, then return the result from the interceptor Closes angular#9821
@IgorMinar - any update on this? :-) |
looking now |
This example probably does a better job of describing the issue than I could: http://jsfiddle.net/ne74rdhg/ When you first click the button, the text does not appear. It appears on a second click. If you switch the same example from
1.3.0-beta.16
to1.3.0-beta.15
, the button works as expected.I spent some time looking into the issue, so let me write down my findings. But I'm not familiar with Angular's insides, so feel free to disregard my ramblings :).
The issue appears after @rodyhaddad 's 86d55c1. The commit has changed how
nodeLinkFn
creates a watcher for=
.parentValueWatch
has become an interceptor.addInterceptor
is strange in that it will always return the pre-interceptor value if it was undefined.In my JSFiddle
greeting
starts out undefined. When it changes,parentValueWatch
copies it up into the controller's scope and returns the new value. ButinterceptedExpression
still returnsundefined
, because the value wasundefined
before running the interceptor. So the watcher is not dirty (it went fromundefined
toundefined
), digest stops, and the change does not propagate intotext
.The text was updated successfully, but these errors were encountered: