Tuesday, 20 August 2013

Display angularFireCollection

Display angularFireCollection

I'm having trouble getting angularFireCollection to work with ng-repeat.
My template is not populating, however, when I execute the add method,
then my ng-repeat list does populate with existing data + the new item I
added.
I would like to see all players in the db load immediately.
I'm initializing my object like this:
`$scope.players = angularFireCollection(url);
My template looks like this:
<li ng-repeat="p in players">{{ p.name }}</div>
Immediately after I initialize $scope.players, I run console.log on
$scope.players, and get this: (note, you can see I have a name value in
the first element set to test.
[getByName: function, add: function, remove: function, update: function,
order: Array[3]]
0: angularFireItem
$$hashKey: "004"
$id: "-J1PUOMGmf0h19PJeUlu"
$index: 0
$ref: J
name: "test"
priority: null
__proto__: angularFireItem
1: angularFireItem
2: angularFireItem
add: function (item, cb) {
getByName: function (name) {
length: 3
order: Array[3]
remove: function (itemOrId, cb) {
update: function (itemOrId, cb) {
__proto__: Array[0]

No comments:

Post a Comment