Is it possible to have routing as follows in angular?
I'm using ui-router for routing, Angular version is 1.4 FYI
.state('home', {
url: '/:city',
controller: 'HomeCtrl',
templateUrl: 'templates/home.html'
})
.state('about', {
url: '/about',
controller: 'AboutCtrl',
templateUrl: 'templates/about.html'
})
.state('login', {
url: '/login',
controller: 'LoginCtrl',
templateUrl: 'templates/login.html'
})
When I tried this way angular is considering both /about
and /login
as home state and giving me "about"
and "login"
in state params is there anyway to override this to have urls as specified?