Skip to content

Instantly share code, notes, and snippets.

@drogus
Created February 20, 2017 10:35
Show Gist options
  • Save drogus/3f1b5dec01105861fe1fb46b7cb689a1 to your computer and use it in GitHub Desktop.
Save drogus/3f1b5dec01105861fe1fb46b7cb689a1 to your computer and use it in GitHub Desktop.
router-basic-route-inheritance-exampl
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('foo');
this.route('bar');
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
});
import Ember from 'ember';
export default Ember.Route.extend({
setupController() {
console.log('setupController');
this._super(...arguments);
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{#link-to "foo"}}Foo{{/link-to}}
{{#link-to "bar"}}Bar{{/link-to}}
{
"version": "0.11.0",
"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.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment