Skip to content
This repository has been archived by the owner on Feb 9, 2020. It is now read-only.

Nested Scopes stop working #201

Closed
johnpapa opened this issue Dec 20, 2014 · 3 comments
Closed

Nested Scopes stop working #201

johnpapa opened this issue Dec 20, 2014 · 3 comments

Comments

@johnpapa
Copy link

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.

@sriram-dev
Copy link

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!

@lvl-svasseur
Copy link

👍

@gary-b
Copy link
Contributor

gary-b commented Jul 17, 2015

I have created a reproduction of the original issue here:
http://gary-b.github.io/ng-version-test-apps/app/v3/index.html

There are 3 nested controllers. nested-a, nested-b, nested-c.
Each controller has a model value associated with it:
nested-a -> scope.a.a
nested-b -> scope.b.b
nested-c -> scope.c.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.

gary-b added a commit to gary-b/angular-hint that referenced this issue Jul 19, 2015
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants