-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Version info
Angular: 2.1.0
Firebase: 3
AngularFire: 2.0.0-beta.6
Other (e.g. Ionic/Cordova, Node, browser, operating system): Ionic
How to reproduce these conditions
Steps to set up and reproduce
Say I subscribe to a list of items:
this.items = this.af.database.list('items');
And I add to these items in another function:
this.items.push({ im: 'cool' });
Then in another function I'd like to iterate through my items:
this.items.forEach(item => {
console.log('Item:', item);
});
Expected behavior
I expect console.log(item) to print out $ Item: { im: 'cool' } but instead it prints out an array for each time I added to the items list.
Actual behavior
The whole array is printed multiple times:
$ Item: []
$ Item: [{ im: 'cool' }]
$ Item: [{ im: 'cool' }, { again: 'yep' }]
mquentin, solidua, gklasen, Villa1013, LiveLikeCounter and 2 more
Metadata
Metadata
Assignees
Labels
No labels