Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Angularfire2 data read is not happening when device going offline #79

Open
sarathscs opened this issue Oct 21, 2017 · 0 comments
Open

Comments

@sarathscs
Copy link

sarathscs commented Oct 21, 2017

Hi,

I am using following ionic configuration with angular 2.

 ordova CLI: 7.1.0
Ionic Framework Version: 3.7.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 2.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.0
Xcode version: Not installed

I am using this ionic application for android. I enabled the angularfire2 offline.

import {
  AfoListObservable,
  AfoObjectObservable,
  AngularFireOfflineDatabase } from 'angularfire2-offline/database';

  constructor(
    private afoDatabase: AngularFireOfflineDatabase){
   this.dashboardChannel = 'dashboard_'+ id;
    this.dashboardItems = this.afoDatabase.list('/'+this.dashboardChannel);
}
getdataOffline(){
  console.log('OFFLINE')
  this.afoDatabase.list('/' + this.dashboardChannel, { preserveSnapshot: true })
  .subscribe(snapshots => {
    snapshots.forEach(snapshot => {
      console.log(snapshot.key, snapshot.val());
      this.Lists = snapshot.val()
    });
  })
}

I am saving the data to firebase when i am online..If the user is offline i will call the getdataOffline method .But am not getting data when i am going offline. I am not using service worker concept .Only using Angularfire2 offline. Please suggest. I really got stuck in this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant