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 has been 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?
The text was updated successfully, but these errors were encountered:
Hi Bart, sorry for my late response. Next time, please mark clearly which exact line of your posted code caused the error as we can't see any lines here ;) Nevertheless, please note that only Collections have to extend from 'Firebase', not models (they stay Backbone.Model.extend({...})). Furthermore your model makes less sense, in order to achieve such functionality in harmony with Backbone's architecture, think about putting the code into the app's router or a controller-like-init-class.
Op 11 apr. 2017 om 08:34 heeft FlxAlbroscheit ***@***.***> het volgende geschreven:
Hi Bart, sorry for my late response. Next time, please mark clearly which exact line of your posted code caused the error as we can't see any lines here ;) Nevertheless, please note that only Collections have to extend from 'Firebase', not models (they stay Backbone.Model.extend({...})). Furthermore your model makes less sense, in order to achieve such functionality in harmony with Backbone's architecture, think about putting the code into the app's router or a controller-like-init-class.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Hi I am trying to run this model:
and in the code I do this:
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:
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?
The text was updated successfully, but these errors were encountered: