Я пытаюсь изменить цвет записей меню навигации, чтобы указать, какая из них является текущей страницей. Но location.path
возвращает пустую строку. Я не получаю других ошибок.
var mflfApp = angular.module("mflfApp", []);
mflfApp.controller('navController', ['$scope', '$location', function ($scope, $location) {
$scope.isActive = function (destination) {
// This function should indicate if the path provide in the destination correspond to the current
// locaiton. This is then used to highlight an option in the navigation menu
// $location.path(); contains a blank string. But does not throws an error.
return destination === $location.path();
}
}]);