NgFor in ion-list has duplicates rows

When using a FirebaseListObservable with an AngularFire2 database list and NgFor in my template i get duplicate rows.


import { Component } from ‘@angular/core’;
import { NavController, NavParams } from ‘ionic-angular’;
import firebase from ‘firebase’;
import {AngularFire, FirebaseListObservable} from ‘angularfire2’;
import { LoadingProvider } from ‘…/…/providers/loading’;
import { GroupAddPage } from ‘…/group-add/group-add’;

      Generated class for the Chats page.

      See for more info on
      Ionic pages and navigation.
      selector: 'page-chats',
      templateUrl: 'chats.html'
    export class ChatsPage {
    	groups: FirebaseListObservable<any>;
    	people: FirebaseListObservable<any>;
    	userProfile: any;
    	chatType: string = "groups";

      constructor(public navCtrl: NavController, public navParams: NavParams, af: AngularFire) {
      this.groups = af.database.list('/Groups');
      this.people = af.database.list('/userProfile/');

      ionViewDidLoad() {
        console.log('ionViewDidLoad ChatsPage');





<ion-list *ngSwitchCase="‘people’">


  				<ion-item color = "amethyst-reverse" detail-push *ngFor="let person of people | async" (click)="goToPersonChat(person)">
    				<ion-avatar item-left>
      					<img src={{person.photoURL}}>
    					<h2>{{person.firstname}} {{person.lastname}}</h2>


This is my end resulting ion-list. I only have three users in my firebase database (User1, User2, and User5)


Is part of your code missing? I don’t understand what the purpose of this.groups is, and I suspect it is causing the problem because you don’t unsubscribe from it. One test you can run is to transition to and from the page multiple times. If you keep getting more duplicate rows, you’re reading the FirebaseListObservable repeatedly – failing to unsubscribe when you leave the page. The async pipe is supposed to unsubscribe you, which means there’s a loose end somewhere else.

Yep, Thanks! I had a subscribe left open from my users profile, so when i transitioned to and from the profile page and my other page it was repeating the FirebaseListObservable. i changed some of my firebase structure and put an async pipe on my user profile observable. This particular issue is resolved.