Sorry for the length of this but it\'s driving me a little bit crazy:
Let\'s say I want to get an item\'s \"title\" and \".priority\" key values when it loads.
F
I believe I am / was experiencing the same issue. Hopefully this is related to your experience. Namely:
$scope.items = $firebase(new Firebase("https://xxxxxx.firebaseio.com"));
$scope.items.$on('loaded', function() {
console.log($scope.items['some key']); // this writes undefined to console
});
What I noticed is that this actually does work if I don't rely on the loaded
event. E.g in the HTML:
click me
and in the JS:
$scope.items = $firebase(new Firebase("https://xxxxxx.firebaseio.com"));
$scope.logItem = function() {
console.log($scope.items['some key']); // this works
}
Clicking on the "click me" link logs my item to the console as expected.
Feels like the collection at loaded
time isn't fully populated with the underlying items from firebase.