Last active
February 19, 2016 06:59
-
-
Save gokatz/94f13b6a2db325a313cd to your computer and use it in GitHub Desktop.
service inj
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
import Ember from 'ember'; | |
import mixin from 'demo-app/mixins/apptest'; | |
export default Ember.Controller.extend(mixin, { | |
appName: Ember.computed(function() { | |
return this.get('appname.name'); //service injected in intializers | |
}), | |
products: Ember.computed(function() { | |
return this.product; //mixin imported | |
}), | |
contactdetails: Ember.computed(function() { | |
return this.contact; ////mixin imported | |
}) | |
}); |
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
export default { | |
name: 'currentUser', | |
initialize: function(container, application) { | |
application.inject('controller', 'appname', 'service:appname'); | |
//application.inject('controller', 'apptest', 'mixin:apptest'); | |
application.inject('route', 'appname', 'service:appname'); | |
} | |
}; |
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
import Ember from 'ember'; | |
let mixin = Ember.Mixin.create({ | |
product: ['mobile software', 'web development', 'wed design'], | |
contact: '[email protected]' | |
}); | |
export default mixin; |
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
import Ember from 'ember'; | |
export default Ember.Service.extend({ | |
name: 'CodeX', | |
//product: ['mobile software', 'web development', 'wed design'] | |
}); |
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
{ | |
"version": "0.5.3", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "1.13.13", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.3.3/ember-data.js", | |
"ember-template-compiler": "1.13.13" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment