I am facing an issue while trying to develop an angular app where the child state is not loading properly.
app.config(function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise("/");
$stateProvider
.state('home', {
url : "/",
templateUrl: "/admin/home/"
})
.state('users', {
url : "/users/",
templateUrl: "/admin/users",
controller : function ($stateParams) {
console.log($stateParams);
console.log("users");
}
})
.state('users.new', {
url : "^/users/user/",
templateUrl: "/admin/users/new",
controller : function () {
console.log("users.new");
}
})
.state('users.user', {
url : "^/users/user/:uuid",
templateUrl: function ($stateParams) {
console.log($stateParams);
return "/admin/users/" + $stateParams.uuid
},
controller : function () {
console.log("users.user");
}
});
When I try to access the URL
/users/user/55d8b1c706387b11480d60c1
I can see that the request to load the page is made, but only the "users" controller is executed.
This issue seems to occur specifically with child states, as switching between parent states is functioning correctly.
I am using the latest versions of Angular and UI-Router.
Any suggestions on how to resolve this?