.state('user-profile', {
url: '/user-profile/:userId', //Parent state
...
.state('user-profile.profile',{ //nested
url:'/profile',
...
如何通过 ui-sref
"user-profile/123/profile"访问 url
目前我正在尝试这个:
<a ui-sref="(user-profile({userId: currentUser._id})).profile">
这将我带到 user-profile/123
最佳答案
您就快完成了,只需先使用state name,然后传递带参数的对象 {}
:
//<a ui-sref="(user-profile({userId: currentUser._id})).profile">
<a ui-sref="user-profile.profile({userId: currentUser._id})">
关于javascript - 带有参数的 ui-sref 嵌套状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37414459/