The routing is not working for me when generating the project in Yeoman, I do not understand the reason.
When I click on any item in the menu, it does not redirect me to that part:
home: link . about: link . loguin: link .
index.html
<div class="collapse navbar-collapse" id="js-navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#/">Home</a></li>
<li><a ng-href="#/about">About</a></li>
<li><a ng-href="#/login">Iniciar sesiòn</a></li>
</ul>
</div>
controllers:
loginCtrl
'use strict';
angular.module('apiFrontApp').controller( 'LoginCtrl' , function(){
var vm = this;
vm.loginForm = {
email : '',
password : ''
};
});
app.js
'use strict';
/**
* @ngdoc overview
* @name apiFrontApp
* @description
* # apiFrontApp
*
* Main module of the application.
*/
var app = angular
.module('apiFrontApp', [
'ngAnimate',
'ngAria',
'ngCookies',
'ngMessages',
'ngResource',
'ngRoute',
'ngSanitize',
'ngTouch',
'satellizer'
]);
app.config(function ($routeProvider, $authProvider , $locationProvider){
$locationProvider.html5Mode(true);
$authProvider.loginUrl =
'http://localhost:8888/api-cat/api-dev/public/auth_login';
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl',
controllerAs: 'main'
})
.when('/about', {
templateUrl: 'views/about.html',
controller: 'AboutCtrl',
controllerAs: 'about'
})
.when( '/login' ,{
templateUrl: 'views/login.html',
controller: 'LoginCtrl',
controllerAs: 'login'
})
.otherwise({
redirectTo: '/'
});
});