Skip to content

Instantly share code, notes, and snippets.

@nem035
Created January 25, 2016 18:28
Show Gist options
  • Save nem035/9b4abaa7a0bbbe353b14 to your computer and use it in GitHub Desktop.
Save nem035/9b4abaa7a0bbbe353b14 to your computer and use it in GitHub Desktop.
Custom Store
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
callStore() {
this.store.customMethod();
}
}
});
<button type="button" {{action "callStore"}}>Click to test custom Store</button>
import DS from 'ember-data';
export default DS.Store.extend({
init: function() {
console.log('Using custom store!');
return this._super.apply(this, arguments);
},
customMethod() {
alert('Custom Store');
}
});
{
"version": "0.5.0",
"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.2.0/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/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