Skip to content

Instantly share code, notes, and snippets.

@michiel
Created June 5, 2014 07:02
Show Gist options
  • Save michiel/c04bcd8c16ea18cbab68 to your computer and use it in GitHub Desktop.
Save michiel/c04bcd8c16ea18cbab68 to your computer and use it in GitHub Desktop.
bootstrap isActive link/li component
// Bootstrap3
App.ActiveLiComponent = Ember.Component.extend({
tagName : 'li',
classNameBindings : ['isActive:active:inactive'],
router: function() {
return this.container.lookup('router:main');
}.property(),
isActive: function() {
var currentWhen = this.get('currentWhen');
return this.get('router').isActive(currentWhen);
}.property('router.url', 'currentWhen')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment