Nested Scopes stop working #201
Comments
Does the latest source code work ? I have installed in developer mode from code (0.7.4) and i see this error. Uncaught Error: [$injector:nomod] Module 'ngLocale' is not available! |
👍 |
I have created a reproduction of the original issue here: There are 3 nested controllers. nested-a, nested-b, nested-c. Within each controllers' view there are text boxes that give access to its model values and those of the controllers in which it is nested. When viewing the model values in the json-tree, changes are propagated as long as the update occurs within the controller in which the model property originates. Updating nested-a's scope.a.a value using the text boxes located within nested-b or nested-c will not result in the value being updated in batarang. |
When scope.apply() was called model:change events were only sent out for the current scope. This meant any updates to inherited properties would not be reflected in Batarang. It also meant any changes to objects that were referenced by multiple scopes would only be updated for the current scope. This would be a relatively common scenario, eg where the page's model is kept in a service and multiple controllers / directives on screen display various elements of it. Since the scopes that share common objects may live outside each others prototype chains, checking for changes in all scopes and paths currently watched. Hopefully the currently watched qualifier here limits the performance impact. Fixes angular/batarang#201
We had a situation where we had a controller (ng-model) --> directive (iso scope) --> ng-repeat --> ng-repeat --> ng-model and it worked, but batarang showed that when the inner model value was changed via a batrang did not show the value propogating up the scope chain. It did indeed propogate, thought. This led the developer to think that angular was flawed or he did something wrong. When we showed it did indeed work through other debugging ({{ xxx | json }} in the view and that ng-inspector worked with it, we realized it was batarang only.
The text was updated successfully, but these errors were encountered: