You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 25, 2018. It is now read-only.
var APP = APP || {};
APP.FBLocationsModel = Backbone.Firebase.Model.extend({
urlRoot: APP.fireBase.config.databaseURL + 'users/',
autoSync: true,
initialize: function () {
this.listenToOnce(this, 'FBInit', this.setUrl);
this.connectWithFirebase();
},
setUrl: function () {
this.url = this.urlRoot + FB.uid + "/locations/";
},
connectWithFirebase: function () {
var that = this;
//check if firebase config is there
if (APP.fireBase.config) {
FB.config = APP.fireBase.config;
} else {
throw("Need firebase config object");
}
//initialize -> auth -> login
FB.init(function () {
that.trigger('FBInit')
});
}
});
and in the code I do this:
APP.fbLocationsModel = new APP.FBLocationsModel();
APP.fbLocationsModel.fetch();
After doing so I get this error in my console:
ReferenceError: Firebase is not defined line 153 in backbonefire.js
Firebase itself is loaded (version 3.6.10)
looking in the code ofr backbonefire.js I see this code:
Backbone.Firebase._determineRef = function(objOrString) {
switch (typeof(objOrString)) {
case 'string':
return new Firebase(objOrString);
case 'object':
return objOrString;
default:
Backbone.Firebase._throwError('Invalid type passed to url property');
}
};
In the case 'string' I is where it says: 'Firebase is not defined' but can't figure out why.
I do use require, maybe that is an issue here?