Last active
August 29, 2015 14:22
-
-
Save mszoernyi/314f4e16a4ed1a38c71f to your computer and use it in GitHub Desktop.
simulate store.find for non ember models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_findCountries: -> | |
isoCodes = Ember.Object.createWithMixins(IsoCodes) | |
countries = (Ember.Object.create({ id: code, name: name }) for code, name of isoCodes.isoCountries) | |
promise = Ember.RSVP.Promise.resolve(countries) | |
promiseArray = Ember.ArrayProxy.extend(Ember.PromiseProxyMixin) | |
promiseArray.create({ promise: promise }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've a list of countries which are not stored in the store and so there is no 'real' ember-data model for it.
This list is used for a selectize box which is rendered dynamically and all other models are fetched from the store via
.find
. What I'm trying to archive is to return the same structure as I get withstore.find()
. The result needs to be apromise
and it has to have acontent
.this returns me an array not an object with a content attribute.