Recently, I made the switch from using ng.router to ui.router in my AngularJS application.
While configuring states in my app, I encountered an issue with state names. It seems that when I include a '.' character in the state name, the routing doesn't function as expected. For example, the code snippet below fails to route to 'views/subcategories.html' when I try entering "localhost/#/categories/5" in the browser URL:
$stateProvider
.state('categories',
{
url:'/categories',
controller:'CategoriesController',
templateUrl:'views/categories.html'
})
.state('sub.categories',{
url:'/categories/:subID',
controller: 'SubCategoriesController',
templateUrl:'views/subcategories.html'
});
Strangely enough, changing 'sub.categories' to just 'subcategories' makes everything work perfectly. This got me wondering if there's something I might be missing here, especially since I've seen plenty of tutorials recommending the use of '.' in state names with ui.router. Any insights on this would be greatly appreciated!