I am encountering an issue with my routing system. The "otherwise" case is functioning correctly, however, when I click on a menu item, the routing does not load the corresponding page automatically. Can someone assist me in identifying what is wrong with my code?
Below is the code related to the routing section:
var myColors = angular.module('myFirstModule', ['ngRoute']);
myColors.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/home', {
templateUrl: 'home.html'
})
.when('/directory', {
templateUrl: 'directory.html',
controller: 'myFirstModule'
}).otherwise({
redirectTo: '/directory'
});
}]);
Here is the HTML div where I have added the links:
<ul>
<li><a href="#/home">Home </a></li>
<li><a href="#/directory">Directory</a></li>
</ul>
Here is a Plunker showcasing my complete code