Created
March 13, 2014 19:21
-
-
Save patrickberkeley/9535024 to your computer and use it in GitHub Desktop.
Set the current path as a class on ember's application view.
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
App.ApplicationView = Ember.View.extend({ | |
classNames: ['app'], // Static classes here. | |
classNameBindings: ['classForPath'], // Your dynamic path here. | |
classForPath: (function() { | |
var currentPath = this.get('controller.currentPath') || ''; | |
currentPath = Ember.String.decamelize(currentPath); | |
currentPath = currentPath.split('.').join('-'); | |
return currentPath; | |
}).property('controller.currentPath') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment