Menu
  • HOME
  • TAGS

Set multiple data with Ember and make it persist on Firebase

ember.js,firebase,emberfire

Restructured your adding logic as well as user defined models, also modified your route, which could look like this in Edit and View mode. Meaning you can have more than one item returned from "model". // Update models App.List = DS.Model.extend({ value: DS.attr('string') }); App.User = DS.Model.extend({ name: DS.attr('string') });...

Saving an html object to firebase

javascript,canvas,ember.js,firebase,emberfire

You have to serialize and deserialize the image: function serialize(canvas) { return canvas.toDataURL(); } function deserialize(data, canvas) { var img = new Image(); img.onload = function() { canvas.width = img.width; canvas.height = img.height; canvas.getContext("2d").drawImage(img, 0, 0); }; img.src = data; } Based on this answer. Update 1 The canvas.toDataURL() method...

How to organize my model

ember.js,firebase,emberfire

If you're sticking with the official emberfire bindings, you can set up three models: User: var user = DS.Model.extend({ name : DS.attr('string'), conversations : DS.hasMany('conversation', { async: true }), convos_users : DS.hasMany('convo_user', { embedded: true }) }); Conversation: var conversation = DS.Model.extend({ messages : DS.hasMany('message', { embedded: true }) });...

Does emberfire 1.3.2 implement findQuery method?

javascript,ember.js,ember-data,firebase,emberfire

It does not yet. I asked this very question a week or so ago on GitHub. However, GitHub user @tstirrat has a fully functional although untested implementation. If you use the code in his PR https://github.com/firebase/emberfire/pull/169 then you can implement a workaround while the final code is debated. Syntax is...

FirebaseAdapter not recognized on my Ember app

ember.js,ember-data,firebase,emberfire

It looks like you need to include app.js after you include EmberFire. There's also a missing semicolon in your router after this.resource('stacks') but I don't think that's causing the error. We just released some updates that make it much easier to use EmberFire as an ember-cli addon, I'd recommend checking...

Uncaught TypeError: Cannot read property 'login' of undefined

ember.js,firebase,emberfire

The issue might be that you are trying to access an injected property, but the code that does the injection is never called. The recommended way to inject properties is described on this page. More specifically the samples below (from the Ember.js website) should help Using an application initializer: App...

EmberFire facebook authentication: nothing happens with authwithOAuthPopup

facebook,ember.js,firebase,firebase-security,emberfire

Your usage of this is invalid because the context changed when you used Promise(). Change your login function to this: login: function() { var _this = this; // cache for usage in Promise return new Promise(function(resolve, reject) { _this.get("ref").authWithOAuthPopup("facebook", function(error, user) { if (user) { resolve(user); } else { reject(error);...

Ember.js authentication action not working

javascript,authentication,ember.js,emberfire

You set userSignedIn before Firebase.authWithOAuthPopup(provider, onComplete, [options]) onComplete callback is fired. Instead, try this: signin: function() { controllerContext = this; ref.authWithOAuthPopup("facebook", function(error, authData) { if (error) { console.log("Login Failed!", error); } else { console.log("Authenticated successfully with payload:", authData); state = true; controllerContext.set('userSignedIn', state); console.log(state); } }); }, // End of...

Saving Ember-Data records

ember.js,ember-data,emberfire

1. author.get('books') will return a promise, so probably what you want to do is author.get('books').then(function(books) { books.pushObject(book) }); author.save(); If this is not an issue, could you give a jsfiddle with the whole app code? Then, it'll be easier to help! :) 2. Every time you get a model's property...

Where to authenticate with customToken using adapters

ember.js,ember-data,emberfire

The error is that it seems EmberFire as of yet does not support a validation child rule. Most probably because it's trying to update the cart before the item is inserted. This was working in Ember 1.7 and a previous version of EmberFire. The rule-block below that does work, with...