Created
October 12, 2012 20:32
-
-
Save Netcelal/3881341 to your computer and use it in GitHub Desktop.
Revisions
-
Netcelal created this gist
Oct 12, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ <div class="well sidebar-nav" ng-app="navList"> <ul class="nav nav-list" ng-controller="navCtrl"> <li ng-class="navClass('home')"><a href='#/home'>Home</a></li> <li ng-class="navClass('about')"><a href='#/about'>About Us</a></li> <li ng-class="navClass('contact')"><a href='#/contact'>Contact Us</a></li> </ul> </div> var navList = angular.module('navList', []); navList.controller('navCtrl', ['$scope', '$location', function ($scope, $location) { $scope.navClass = function (page) { var currentRoute = $location.path().substring(1) || 'home'; return page === currentRoute ? 'active' : ''; }; }]);