当我尝试使用EmberFire的offline-firebase时,我收到了这些错误(没有任何内容保存到firebase):
adapters/application.js
export default DS.FirebaseAdapter.extend({
firebase: new OfflineFirebase('https://woot.firebaseio.com/quiz').on('value', function(snapshot){
console.log(snapshot);
}, undefined, undefined, true)
});
app.js
OfflineFirebase.restore();
index.html
<script src="cordova.js"></script>
<script src="js/firebase-debug.js"></script>
<script src="js/OfflineFirebase.js"></script>
<script src="assets/vendor.js"></script>
<script src="assets/woot-prototype.js"></script>
controllers/index.js
export default Ember.ArrayController.extend({
init: function() {
this.set('user', Ember.Object.create());
},
actions: {
getUser: function(){
var newUser = this.store.createRecord('user', {
email: this.get('user.email'),
name: this.get('user.name')
});
console.log(newUser);
newUser.save();
}
}
});
这是离线firebase问题还是我做错了什么? :) https://github.com/yeldarby/offline-firebase/issues/6