我有一个父状态,其中url被映射为'/',当我访问root时,例如:http://localhost:8081/sin/TPW/,它将我重定向到具有空url的子状态。
我不知道它为什么选择这个子状态,因为还有其他子状态也有空URL,并且它们没有被调用。
被调用的状态是 parent.foto3
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('!');
$stateProvider
.state('parent', {
url: '/',
views: {
'$default': {
component: 'parent'
}
}
})
.state('parent.token', {
url:'open?k',
views: buildViews('tokenless', false, true),
})
.state('parent.confirmacao', {
url: '',
params: {aviso: {dynamic: true}},
views: buildViews('confirmacao', true),
})
.state('parent.cancelada', {
url: '',
views: buildViews('cancelada'),
})
.state('parent.foto1', {
url: '',
views: buildViews('foto1', true),
})
.state('parent.foto2', {
url: '',
views: buildViews('foto2', true),
})
.state('parent.foto3', {
url: '',
views: buildViews('foto3', true),
})
.state('parent.foto4', {
url: '',
views: buildViews('foto4', true),
})
.state('parent.foto5', {
url: '',
views: buildViews('foto5', true),
})
.state('parent.foto6', {
url: '',
views: buildViews('foto6', true),
})
.state('parent.concluido', {
url: '',
views: buildViews('concluido'),
})
.state('parent.erro', {
url: 'err',
params: {erro: {dynamic: true}},
views: buildViews('erro'),
});
$urlRouterProvider.otherwise('err');
Angular:1.6 ui-router:1.0.3