3

I'm working with the ionic-framework version 2 and typescript.

Last week I integrated Firebase in my app, which worked fine. Now I want to integrate geofire too, but I can't initialize an instance of a geofire object.

My MainSearchPage class:

import { Component, Inject } from '@angular/core';
import { AngularFire, FirebaseListObservable, FirebaseApp } from 'angularfire2';
import { GeoFire } from 'geofire';

constructor(public af: AngularFire, @Inject(FirebaseApp) firebaseApp: firebase.app.App) {
    var firebaseRef = firebaseApp.database().ref();
    var geofire = new GeoFire(firebaseRef);
}

But I always get the following error:

Error in ./MainSearchPage class MainSearchPage_Host - caused by: WEBPACK_IMPORTED_MODULE_7_geofire.GeoFire is not a constructor

Versions:

ionic-app-script 1.3.1,
typescript 2.0.6,
firebase 3.7.5,
angularfire 2.0.0-beta.8,
geofire 4.1.2,

I would appreciate any help.

L1N51
  • 31
  • 3

1 Answers1

0

Try importing Geofire like this

import * as GeoFire from "geofire";

  • Welcome to stackoverflow!! Try to avoid comment in answer unless you have specific answer. Please use comment box below and Once you have sufficient reputation you will be able to comment on any post. :) – Rucha Bhatt Joshi Jun 26 '17 at 08:54