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
The $child
method should only be used to create a new AngularFire reference. Calling $child
is the same as calling $firebase(new Firebase(parentULR + "/childName"))
. In your example, if all you are trying to do is to get the $priority
and title
for a given object, you can simply do:
$scope.items = $firebase(new Firebase("https://****.firebaseio.com"));
$scope.items.$on('loaded', function() {
var item = $scope.items['your-item-id'];
console.log(item['$priority']);
console.log(item.title);
});
If you don't know the ID of your item, you can iterate over the $scope.items
object to find it if you'd like.