The Issue
I seem to be getting the following error with emberfire, I followed the documentation yet still get the error:
Uncaught TypeError: this._ref.push is not a function
at Class.generateIdForRecord (firebase.js:75)
at Class._generateId (-private.js:10359)
at Class.createRecord (-private.js:10325)
at Class.test (home.js:13)
at Class.send (action_handler.js:32)
at action.js:141
at exports.flaggedInstrument (ember-metal.js:3730)
at action.js:140
at Backburner.run (backburner.js:537)
at run (ember-metal.js:4267)
The following code is where the error comes from, the code is simply placed in an action in a controller called home:
var newGlobal = this.store.createRecord('global', {
about: 'test',
});
newGlobal.save();
The rules on the database are set up as:
{
"rules": {
".read": true,
".write": true
}
}
and the database is empty.
I have also setup config/environment.js
Any ideas please?
Thank you in advance
Helpful Links
This is now solved, the issue was I had created a custom ember service called firebase
.
I had injected it in the home
controller like so:
firebase: Ember.inject.service()