I don't know why my template is not loading when I access the '/todo-list' state URL.
// main.js - routes
angular.module('myapp', ['ui.router'])
.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('todolist', {
url: '/todo-list',
view: {
'@': {
template: 'test!',
}
}
})
.state('otherwise', {
url: '*path',
template: 'Oops! Blank page!' // <- the otherwise is working
});
}]);
.
// index.html
<html ng-app="app">
<head>
<title>Project</title>
<script src="./js/lib/angular.min.js"></script>
<script src="./js/lib/angular-ui-router.js"></script>
<script src="./js/main.js"></script>
</head>
<body>
<div class="container">
<ui-view></ui-view>
</div>
</body>
</html>
The 'otherwise' works ok, but when I navigate to '/todo-list' it gives to me a blank page. The route is working.. but not the template. Is it something related to the ui-view element?