angular / batarang

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

fix(background.js) destroy child scopes #228

Closed gary-b closed 9 years ago

gary-b commented 9 years ago

This code requires the fix to angular-hint submitted as pull request https://github.com/angular/angular-hint/pull/90 (It is very easy to manually patch the hint.js file in the Batarang project with this fix for testing purposes also.)

Destroyed scopes were not being removed from the scope tree. The background.js and inspectedApp code that handled the scope:destroy message was buggy, referencing undefined variables and also not tracking the descendants of the destroyed scopes. This code fixes both issues. All descendants are now present on the scope:destroy message broadcast throughout Batarang. This reduces code that would need repeated in background.js, inspectedApp and probably in future scope.tree.js to fix https://github.com/angular/angularjs-batarang/blob/master/panel/components/scope-tree/scope-tree.js#L77

SomeKittens commented 9 years ago

Very nice, thanks!

Landed @ https://github.com/angular/angularjs-batarang/commit/0dd8b9cb2359fcc3966c2c68832131ff6eed3170