Using 'ngRoute', There are 3 different links on the page, each directs to its own ng-view using different controllers, when clicked on a specific link, a function runs which strips off 'active' class from all the links and put 'active' class on the cliced link.
THE PROBLEM: after i choose a specific link, it gets highlighted because of the 'active' class. BUT when I REFRESH the page, everything goes fine, I'm still on the ng-view i need BUT.. the 'activated link' is no longer highlighted, and the default link is.
bookApp.controller('mainController', function($rootScope, $scope, $route) {
$scope.setActive = function(event) {
var links = document.querySelectorAll('.menu ul li a');
for (var i = 0; i < links.length; i++ ) {
links[i].className = '';
}
angular.element(event.target).parent().addClass('active');
};
};