service intializzer to default controller
{
"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"
}
}
{{#link-to 'application'}}To Home{{/link-to}}
<br>
NAME : {{model}}
<br>
AGE : {{test.age}}
<h1>Welcome to {{appName}}</h1>
<br>
{{#link-to 'my-route'}}To My Route{{/link-to}}
<br>
AGE : {{test.age}}
<hr>
{{outlet}}
<br>
<br>
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
import Ember from 'ember';
export default Ember.Service.extend({
age: 20
});
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return 'gokul';
}
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none'
});
Router.map(function() {
this.route('my-route');
});
export default Router;
export default {
name: 'currentUser',
after: 'store',
initialize: function(container, application) {
application.inject('controller', 'test', 'service:test');
}
};
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});