offline-firebase icon indicating copy to clipboard operation
offline-firebase copied to clipboard

offline-firebase does not work EmberFire (and ember-cli)

Open codepreneur opened this issue 10 years ago • 1 comments

When I try to use offline-firebase with EmberFire, I get these errors (and nothing gets saved to firebase):

pasted image at 2014_10_07 05_38 pm

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();
        }
    }
});

Is this offline-firebase problem or I am doing something wrong? :) http://stackoverflow.com/questions/26297464/offline-firebase-does-not-work-emberfire-and-ember-cli

codepreneur avatar Oct 10 '14 10:10 codepreneur

Unfortunately I have never played with Ember so I'm not sure. If you get it working can you post back with an update?

I'd be happy to accept a pull request that adds support for ember-fire or add some docs for how to get it working.

yeldarby avatar Oct 10 '14 11:10 yeldarby