fix(inspectedApp): ignore events with missing scope info

test-unit-sauce
Brian Ford 10 years ago
parent aa1c792d1a
commit a521bb9ea3

@ -64,19 +64,21 @@ function inspectedAppService($rootScope) {
function onHintMessage(hint) { function onHintMessage(hint) {
if (hint.message) { if (hint.message) {
hints.push(hint); hints.push(hint);
} else if (hint.event === 'model:change') { } else if (hint.event) {
scopes[hint.id].models[hint.path] = (typeof hint.value === 'undefined') ? if (hint.id) {
undefined : JSON.parse(hint.value); if (hint.event === 'scope:new') {
} else if (hint.event === 'scope:new') { addNewScope(hint);
addNewScope(hint); } else if (scopes[hint.id]) {
} else if (hint.event === 'scope:link') { if (hint.event === 'model:change') {
scopes[hint.id].descriptor = hint.descriptor; scopes[hint.id].models[hint.path] = (typeof hint.value === 'undefined') ?
} undefined : JSON.parse(hint.value);
} else if (hint.event === 'scope:link') {
if (hint.event) { scopes[hint.id].descriptor = hint.descriptor;
}
}
}
$rootScope.$broadcast(hint.event, hint); $rootScope.$broadcast(hint.event, hint);
} }
} }
function onRefreshMessage() { function onRefreshMessage() {