I'm making a tutorial mixing AngularJS and Spring Boot that run on a Tomcat server and I'm trying to make a route work but it just doesn't seem to be doing anything. Do you guys see anything wrong here? I've done angular routing before but had no trouble, I think that something is happening due to the fact that it runs in Tomcat...
This is the page that calls the route:
<!DOCTYPE html>
<html ng-app="appCliente">
<head>
<meta charset="UTF-8"/>
<title>Insert title here</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-route.js"></script>
<script src="./js/app.js"></script>
<script src="./js/controller/cliente-controller.js"></script>
<script src="./js/controller/estado-controller.js"></script>
<script src="./js/controller/cidade-controller.js"></script>
</head>
<body>
<a href="#/clientes">Clientes</a>
<div ng-view="ng-view">
</div>
</body>
</html>
And this is the app declaration JS file:
var appCliente = angular.module('appCliente', ['ngRoute']);
appCliente.config(function($routeProvider){
$routeProvider
.when('/clientes', {
controller:'clienteController',
template: '<h2>Something</h2>'
})
.otherwise({
redirectTo:'/'
});
});
Any idea of what seems to be the problem?
(I noticed that when I try to load the initial page - http://localhost:8080/ - Spring Boot is putting some characters after the url automatically - http://localhost:8080/#!/ - but it loads normally)