Attempting to develop a Spring Boot application using AngularJS, with the following project structure:
The controller successfully calls the index.html file:
Snippet from app.js:
var app = angular.module('app', ['ngRoute','ngResource']);
app.config(function($routeProvider){
$routeProvider
.when('/users',{
templateUrl: 'views/users.html',
controller: 'usersController'
})
.when('/roles',{
templateUrl: 'views/roles.html',
controller: 'rolesController'
})
.otherwise(
{ redirectTo: '/'}
);
});
Upon running the application, the initial page loads, but clicking on the users and roles links does not navigate.
UPDATED: the index.html code is as follows:
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Spring boot and Angularjs Tutorial</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/css/app.css">
</head>
<body>
<h2>Administrator Panel</h2>
<div class="home-section">
<ul class="menu-list">
<li><a href="#/users">Users</a></li>
<li><a href="#/roles">Roles</a></li>
</ul>
</div>
<div ng-view></div>
<script src="/lib/angular.js"></script>
<script src="/lib/angular-resource.js"></script>
<script src="/lib/angular-route.js"></script>
<script src="/js/app.js"></script>
<script src="/js/controller.js"></script>
<link href="/css/bootstrap.css" rel="stylesheet" />
</body>
</html>
Seeking guidance on resolving this navigation issue.
[1]: