This repository was archived by the owner on Feb 9, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
panel/components/inspected-app Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -80,18 +80,25 @@ function inspectedAppService($rootScope, $q) {
80
80
if ( hint . event === 'scope:new' ) {
81
81
addNewScope ( hint ) ;
82
82
} else if ( hint . id && scopes [ hint . id ] ) {
83
- if ( hint . event === 'model:change' ) {
84
- scopes [ hint . id ] . models [ hint . path ] = ( typeof hint . value === 'undefined' ) ?
83
+ var scope = scopes [ hint . id ] ;
84
+ if ( hint . event === 'scope:destroy' ) {
85
+ if ( scope . parent ) {
86
+ scope . parent . children . splice ( scope . parent . children . indexOf ( child ) , 1 ) ;
87
+ }
88
+ delete scopes [ hint . id ] ;
89
+ } else if ( hint . event === 'model:change' ) {
90
+ scope . models [ hint . path ] = ( typeof hint . value === 'undefined' ) ?
85
91
undefined : JSON . parse ( hint . value ) ;
86
92
} else if ( hint . event === 'scope:link' ) {
87
- scopes [ hint . id ] . descriptor = hint . descriptor ;
93
+ scope . descriptor = hint . descriptor ;
88
94
}
89
95
}
90
96
$rootScope . $broadcast ( hint . event , hint ) ;
91
97
}
92
98
}
93
99
94
100
function onRefreshMessage ( ) {
101
+ clear ( scopes ) ;
95
102
hints . length = 0 ;
96
103
}
97
104
@@ -106,4 +113,10 @@ function inspectedAppService($rootScope, $q) {
106
113
}
107
114
}
108
115
116
+ function clear ( obj ) {
117
+ Object . keys ( obj ) . forEach ( function ( key ) {
118
+ delete obj [ key ] ;
119
+ } ) ;
120
+ }
121
+
109
122
}
You can’t perform that action at this time.
0 commit comments