I don't understand why my routing doesn't work, the "otherwise" case is working, but when I click in one of the menu the routing doesn't automatically load the relative page. Can anyone help me to understand what's wrong with my code please?
This is the code relative to the routing part:
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 it is the HTML div where I put the links:
<ul>
<li><a href="#/home">Home </a></li>
<li><a href="#/directory">Directory</a></li>
</ul>
Here is a Plunker of my full code