Reputation: 7576
So I have an object that looks like this:
Clearly it contains two keys "200001" and "201601".
But when I try to access those two variables I get undefined!
Code bellow:
console.warn($rootScope.layout);
console.log('layout 200001', $rootScope.layout[200001]);
console.log('layout 201601', $rootScope.layout[201601]);
Am I missing something?
Upvotes: 0
Views: 780
Reputation: 2009
Where are you calling this code and where do they get defined?
I think they get defined later than the console.log
is called. When you click/expand the $rootScope
variable in the chrome console, Chrome re-evaluates the variable then you can see them.
Upvotes: 1