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

Commit 392b49a

Browse files
gary-bbtford
authored andcommitted
fix(inspectedApp) support string ids
The jsonTree was not displaying for angular 1.2 apps as inspectedApp was attempting to convert ids to integer form while angular 1.2 ids are strings. Removing conversion. Fixes issue #231
1 parent d8ded07 commit 392b49a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

panel/components/inspected-app/inspected-app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function inspectedAppService($rootScope, $q) {
4848
};
4949

5050
function invokeAngularHintMethod(method, scopeId, path, value) {
51-
var args = [parseInt(scopeId, 10), path || ''].
51+
var args = [scopeId, path || ''].
5252
map(JSON.stringify).
5353
concat(value ? [value] : []).
5454
join(',');

panel/components/inspected-app/inspected-app.spec.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,17 @@ describe('inspectedApp', function() {
159159
expect(chrome.devtools.inspectedWindow.eval).toHaveBeenCalledWith('angular.hint.unwatch(1,"")');
160160
});
161161
});
162-
163-
162+
164163
describe('inspectScope', function () {
165164
it('should call chrome devtools APIs', function() {
166165
inspectedApp.inspectScope(2);
167166
expect(chrome.devtools.inspectedWindow.eval).toHaveBeenCalledWith('angular.hint.inspectScope(2,"")');
168167
});
168+
169+
it('should handle angular 1.2 style string ids', function() {
170+
inspectedApp.inspectScope('002');
171+
expect(chrome.devtools.inspectedWindow.eval).toHaveBeenCalledWith('angular.hint.inspectScope("002","")');
172+
});
169173
});
170174

171175
function createMockChrome() {

0 commit comments

Comments
 (0)