Skip to content

Instantly share code, notes, and snippets.

@jgwhite
Created March 8, 2016 10:30
Show Gist options
  • Save jgwhite/40018834af870481e7a7 to your computer and use it in GitHub Desktop.
Save jgwhite/40018834af870481e7a7 to your computer and use it in GitHub Desktop.
Alt Store
import Ember from 'ember';
import DS from 'ember-data';
const { Store } = DS;
const { inject, computed } = Ember;
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
altStore: inject.service(),
isStoreInstance: computed('altStore', function() {
return this.get('altStore') instanceof Store;
})
});
<pre>{{altStore}}
instanceof DS.Store? {{isStoreInstance}}</pre>
import DS from 'ember-data';
export function initialize(app) {
app.register('service:alt-store', DS.Store);
}
export default {
name: 'alt-store',
initialize
};
{
"version": "0.6.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.3.1/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.3.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment