Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@eliperelman
Last active January 2, 2016 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliperelman/8310055 to your computer and use it in GitHub Desktop.
Save eliperelman/8310055 to your computer and use it in GitHub Desktop.
var siteRoutes = {
'login': 'layouts/login',
'index': 'layouts/site'
};
App.ApplicationView = Ember.View.extend({
layoutName: function () {
var currentPath = this.get('controller.currentPath');
if (siteRoutes[currentPath]) {
return siteRoutes[currentPath];
}
}.property('controller.currentPath'),
updateLayout: function () {
this.rerender();
}.observes('layoutName')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment