Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Created March 17, 2015 21:39
Show Gist options
  • Save typeoneerror/cbbd6cd930e6d495d535 to your computer and use it in GitHub Desktop.
Save typeoneerror/cbbd6cd930e6d495d535 to your computer and use it in GitHub Desktop.
// router.js
import Ember from 'ember';
import config from './config/environment';
let Router = Ember.Router.extend({
location: config.locationType
});
let accountRoutes = function(router) {
router.route('account', { path: 'account' }, function() {
this.route('password', { path: 'change_password' });
this.route('preferences');
});
};
Router.map(function() {
accountRoutes(this);
this.route('admin', { path: 'admin' }, function() {
accountRoutes(this);
});
});
export default Router;
// router.js
import Ember from 'ember';
import config from './config/environment';
let Router = Ember.Router.extend({
location: config.locationType
});
Router.concern('account', function() {
this.route('account', { path: 'account' }, function() {
this.route('password', { path: 'change_password' });
this.route('preferences');
});
});
Router.map(function() {
this.concerns('account');
this.route('admin', { path: 'admin' }, function() {
this.concerns('account');
});
});
export default Router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment