Skip to content

Instantly share code, notes, and snippets.

@igorstajic
Last active June 14, 2016 06:22
Show Gist options
  • Save igorstajic/58588a0ce533b11d8a712d1a292fd845 to your computer and use it in GitHub Desktop.
Save igorstajic/58588a0ce533b11d8a712d1a292fd845 to your computer and use it in GitHub Desktop.
service-test
import Ember from 'ember';
export default Ember.Component.extend({
logger: Ember.inject.service(),
actions: {
test() {
this.get('logger').log("testing");
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
logger: Ember.inject.service(),
});
import Ember from 'ember';
export default Ember.Service.extend({
log(message) {
alert(message);
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{log-button}}
<br>
<br>
<button {{action 'test'}}>test</button>
{
"version": "0.8.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.5.1",
"ember-data": "2.5.2",
"ember-template-compiler": "2.5.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment