如何将当前URL转换为相应的状态?结果状态将用于使用 $state.go 进行状态转换。
示例: http://localhost/auth/enterprise/
注册路线:
{
"stateName": "auth.context",
"url": ":context"
}
结果:auth/enterprise/=> auth.context
示例: http://localhost/auth/enterprise/esdrubal
注册路线:
{
"stateName": "auth.context",
"url": ":context/:username"
}
结果:auth/enterprise/esdrubal => auth.context
最佳答案
解决方案:
You can expose the internal state implementation by using the .decorator hook on $stateProvider. You can decorate any property of the state builder; I chose 'parent' arbitrarily.
关于javascript - 使用 ui-router AngularJS 1.x 获取给定 url 的状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33521286/