Skip to content

Instantly share code, notes, and snippets.

@feanor07
Created April 19, 2017 19:20
Show Gist options
  • Save feanor07/e150fb8a9094379d8146feb261b6def0 to your computer and use it in GitHub Desktop.
Save feanor07/e150fb8a9094379d8146feb261b6def0 to your computer and use it in GitHub Desktop.
so#43493092
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('doctor', function() {
this.route('visit', {
path: '/visit/:visit_id'
}, function() {
this.route('order');
});
});
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return 'this is doctor route';
}
});
import Ember from 'ember';
export default Ember.Route.extend({
model(params) {
return 'this is visit route ' + params.visit_id;
}
});
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return 'this is order route';
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{#link-to 'doctor.visit.order' 1}}Link for visit with id 1{{/link-to}}
<br>
{{#link-to 'doctor.visit.order' 2}}Link for visit with id 2{{/link-to}}
<br>
{{outlet}}
<br>
<br>
{{model}}
<br>
{{outlet}}
{{model}}
<br>
{{outlet}}
{
"version": "0.12.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.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment