I recently set up my configuration file in a simple way
$stateProvider
.state('app', {
'url': '/app',
'abstract': true,
'templateUrl': 'views/layout/index.html',
'controller': 'App'
})
.state('app.home', {
'url': '/home',
'views': {
'appContent': {
'templateUrl': 'views/home/index.html',
'controller': 'Home'
}
}
});
.state('app.asd', {
'url': '/asd/:idContact?',
'views': {
'appContent': {
'templateUrl': 'views/asd/index.html',
'controller': 'Asd'
}
}
});
$urlRouterProvider.otherwise('/app/home');
If I visit app/asd/7
everything works fine but if I try app/asd
it redirects me
Now, I am trying to figure out how to make the idContact parameter not required. I attempted using the classic $routeProvider syntax for this issue :(