I'm a new AngularJs developper and i'm working on a java web application using Spring MVC and angularJs.
I want to include ui-router in my project but i'm facing some issue.
I'm trying to learn how nesting state works with ui-router in AngularJs. But, it is not working. in fact, the ui-routing is not working, i dont' know why
I made and example with a sample test project structured as followed:
Here is my index.html file
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<script src="js/angular.min.js"></script>
<script src="js/angular-ui-router.min.js"></script>
<script src="js/app.js"></script>
<title>Test angularJs Nesting</title>
</head>
<body ng-app="example">
This is the index level
<br>
<div ui-view></div>
</body>
</html>
Here is my app.js file
var example=angular.module("example", ['ui.router']);
example.config(function($stateProvider, $urlRouterProvider){
$stateProvider
.sate("settings", {
url: "/settings",
templateUrl: "templates/settings.html"
})
.sate("settings.profile", {
url: "/profile",
templateUrl: "templates/profile.html"
})
.sate("settings.account", {
url: "/account",
templateUrl: "templates/account.html"
});
$urlRouterProvider.otherwise("/settings/profile");
});
Here is my settings.html file
This is our settings layout
<br>
<a ui-sref="settings.profile">Show Profile</a>
<a ui-sref="settings.account">Show Account</a>
<div ui-view></div>
Here is my profile.html file
<div>
This is a profile page
</div>
Here is my account.html file
<div>
This is a account page
</div>
i expect the content of settings.html to be displayed on the ui-view. but it is not the case. nothing displayed
please, what's missing in my example? have i lost some angularJs configuration?
Thanks in advance for your answer
