Skip to content

Instantly share code, notes, and snippets.

@wende
Created June 16, 2015 15:18
Show Gist options
  • Save wende/2f8ccd4574ef01170ca0 to your computer and use it in GitHub Desktop.
Save wende/2f8ccd4574ef01170ca0 to your computer and use it in GitHub Desktop.
.run ($location, $rootScope) ->
$rootScope.isActive = (path) ->
$location.path().replace(/\?.*/,"") == path
<ul class="nav navbar-nav">
<li ng-class="{ active: isActive('/')}"><a href="#/">Home</a></li>
<li ng-class="{ active: isActive('/about')}"><a ng-href="#/about">About</a></li>
<li ng-class="{ active: isActive('/createlint')}"><a ng-href="#/createlint">Create</a></li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment