Outer change is stronger than the inner one when they are both changed and using one-way binding #14546
Description
Do you want to request a feature or report a bug?
Bug (?)
What is the current behavior?
I'm not sure if bug or by design, but when using one-way (<
), if both the outer and inner scope have been changed, the outer is stronger, even if the inner's change happened after the outer one.
http://jsbin.com/zunoraquju/1/edit?html,js,output
What is the expected behavior?
I would simply expect that the last change is stronger, that's what happens till now with two-way (=
). You can change my attached example to =
and it will work.
What is the motivation / use case for changing the behavior?
Actually a common case - if the passed value is X
I want to change it to be Y
(in constructor / $onInit
) and display it, but preserve the one-way so the outer scope won't get the update.
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
1.5+
Other information (e.g. stacktraces, related issues, suggestions how to fix)
Relevant test (I would expect it to be misko
)