我有一个很长的州名单:
export default ($stateProvider) => {
'ngInject'
$stateProvider
.state({
name: 'agent.contact',
url: '/contact',
abstract: true,
component: 'agentContact'
})
.state({
name: 'agent.contact.list',
url: '/list',
component: 'agentContactListPage',
data: {
title: 'agent.commonLabel.myContacts'
},
resolve: {
preferences: (ContactService) => ContactService.getContactPreferences()
}
})
.state({
name: 'agent.contact.list.overlay',
abstract: true,
data: {
skipFooter: true,
cancelState: 'agent.contact.list'
},
views: {
'overlay@agent.': {
component: 'overlayContent'
}
}
})
.state({
name: 'agent.contact.create',
url: '/create',
abstract: true,
data: {
skipSubmenu: true,
},
resolve: {
contact: ($stateParams, ContactService) => ContactService.getNewContact($stateParams.type)
}
})
}
我正在寻找一个解决方案来动态化各州的声明,同时考虑到所有州都与agent.contact相关联。
我可以利用哪些解决方案?
发布于 2018-05-29 14:59:34
这是抽象状态的要点。
$stateProvider
.state({
name: 'agent.contact',
url: '/contact',
abstract: true,
component: 'agentContact',
resolve: {
preferences: (ContactService) => ContactService.getContactPreferences()
},
children: [{
name: 'list',
url: '/list',
component: 'agentContactListPage',
data: {
title: 'agent.commonLabel.myContacts'
}
}]
})
https://stackoverflow.com/questions/-100004579
复制相似问题