angular / batarang

AngularJS WebInspector Extension for Chrome
MIT License
2.43k stars 338 forks source link

fix(jsonTree): detect deep model changes via events #219

Closed gary-b closed 9 years ago

gary-b commented 9 years ago

Sometimes when navigating around the scopeTree the jsonTree didn't update. I believe this was caused by the $watch on the model in jsonTree being passed the objectEquality flag. This results in the use of the angular.equals function to detect if the model has changed. This function ignores any properties that start with a $... Thus when only the $properties were different across multiple models, $watch didn't trigger. The solution: a) Use a watch with reference equality to detect when the user selects a different scope to inspect. b) Listen for model:change events to detect when the model has been updated from ngHint.

SomeKittens commented 9 years ago

Fantastic. And thanks for the tests!

Landed in 88567aea2cdb22a84218b48d1093186ecfd46849