ncaught TypeError: Cannot read property 'Promise' of undefined

510 views
Skip to first unread message

Adi Hash

unread,
Mar 7, 2015, 7:39:47 PM3/7/15
to fireba...@googlegroups.com
Hi,
I nedd some help with geofire.
I am trying something like that:

  function success(position) {
    if (option === 'set_location') {
      console.log(geoService);
      restaurants.$child(restaurant.$id).$update({location: {lat: position.coords.latitude, lon: position.coords.longitude}}); //works till here.
      var $setRestPosition = geoService.set(restaurant.$id, [position.coords.latitude,position.coords.longitude]);

      $setRestPosition.then(function(){
       console.log('test')
        });
      return $setRestPosition
    }
  }
I'm getting:
ncaught TypeError: Cannot read property 'Promise' of undefined
n
n.set
 success
The console displays this for the geoService( when it is collapsed.):

n {set: function, get: function, remove: function, query: function}:....


I am not using the angular geofire client.

Thanks.









Jacob Wenger

unread,
Mar 7, 2015, 8:15:02 PM3/7/15
to fireba...@googlegroups.com
Hey there,

Make sure you are including the RSVP library. See the notes for that here. You can find the RSVP library here.

Jacob

Adi Hash

unread,
Mar 9, 2015, 5:33:58 PM3/9/15
to fireba...@googlegroups.com
Thanks,
yes some how I linked to a wrong RSVP.
but still it's not working....
so now this:
   ......
    var geo = dataService.$child('restaurantsLocations');
    var geoFire = new GeoFire(geo);
   ........


      geoFire.set(restaurant.$id, [position.coords.latitude,position.coords.longitude]).catch(function(err) {
      console.log(err);
    });
returns

message: "undefined is not a function".

thanks.

Jacob Wenger

unread,
Mar 9, 2015, 5:38:35 PM3/9/15
to fireba...@googlegroups.com
Hey Adi,

I've got a couple comments:
  • By the fact that you are using the method $child(), I assume you are using an old version of AngularFire. We actually no longer even really support that version (pre-0.8.0). We just announced AngularFire 1.0.0, so I'd upgrade to get the latest and greatest.
  • On the same note as the above, you should upgrade to a more recent copy of Firebase. We are already up to 2.2.2.
  • undefined is not a function doesn't really give me much to go off of. But if I had to guess, it could be due to the out-of-date dependencies mentioned above. Upgrading should fix this issue. Otherwise, I will need you to put together a live repro in something like Plunker or Codepen and I will take a look.
Jacob

Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/8516761c-481f-453a-bfc1-5fe82764c256%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Adi Hash

unread,
Mar 10, 2015, 2:56:49 PM3/10/15
to fireba...@googlegroups.com
Thanks, I'll start working on the migration.
Reply all
Reply to author
Forward
0 new messages