Not able to invoke subscribe function 2nd times

Dear All,

I am facing issues while calling subscribe function first time its calling and getting records but second time when I back to the same page then I am not getting any data.

Step 1: Created Service (urx.service.ts)

private userTrxCollection: AngularFirestoreCollection;
private userTrxs: Observable<UserTrx>;
constructor(public db: AngularFirestore) {
this.userTrxCollection = db.collection(‘userTrxs’);
this.userTrxs = this.userTrxCollection.snapshotChanges().pipe(
map(actions => {
return => {
const data =;
const id =;
return { id, …data };

Step 2: created one page and import this service (

ngOnInit() {


async loadUserTrx() {
const loading = await this.loadingController.create({
message: ’ ’


await loading.present();
this.userTrxs = ucash;
this.userTrxs = this.userTrxs.filter(res=> res.userEmail == this.userEmail)
for(let tx of this.userTrxs){
this.total_Trx = this.total_Trx + tx.cost;
this.total_Trx=Math.round(this.total_Trx * 100) / 100;
this.total_Trx_Balance = this.total_WalletAmt - this.total_Trx;


Login the page and got all the data so far its fine now i cam back to this page from another one this subscribe function not working for me.

Please help me out.

I have tried ngDestroy function to unsubscribe collection but no luck.

Your help would be appreciated

please let me know if you need more clarity of the above.



Thanks for this information. It is very useful