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

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

@sarathscs

Description

@sarathscs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions