Created
March 17, 2015 21:39
-
-
Save typeoneerror/cbbd6cd930e6d495d535 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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