AngularJS : 如何使用 $state.go 在嵌套状态路由中传递查询字符串
AngularJS : How to use $state.go to pass querystring in nested state routing
如何使用 $state.go
将查询字符串传递到嵌套状态路由中?
代码:
.state('masterform', {
url: "/masterform?action&assetId&contentTypeId&folderid",
views: {
content: {
templateUrl: 'components/masterform/masterform.html',
controller: 'masterformCtrl as masterform'
}
}
})
.state('masterform.access', {
url: "/access",
views: {
content: {
templateUrl: 'components/masterform/access/access.html',
controller: 'accessCtrl as access'
}
}
})
谢谢。
您可以使用 $state.go()
的第二个选项简单地传递查询字符串参数。
喜欢:
$state.go('masterform', {action:'Get', assetId:1234, folderId:999});
如何使用 $state.go
将查询字符串传递到嵌套状态路由中?
代码:
.state('masterform', {
url: "/masterform?action&assetId&contentTypeId&folderid",
views: {
content: {
templateUrl: 'components/masterform/masterform.html',
controller: 'masterformCtrl as masterform'
}
}
})
.state('masterform.access', {
url: "/access",
views: {
content: {
templateUrl: 'components/masterform/access/access.html',
controller: 'accessCtrl as access'
}
}
})
谢谢。
您可以使用 $state.go()
的第二个选项简单地传递查询字符串参数。
喜欢:
$state.go('masterform', {action:'Get', assetId:1234, folderId:999});