使用 ui-router 进入祖父母状态 [英] Go to grandparent state with ui-router

查看:37
本文介绍了使用 ui-router 进入祖父母状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 ui-router 我可以使用 $state.go('^') 转到父状态,而无需指定它的完整路径.有没有类似的方法可以进入祖父母状态(我的父母状态是抽象的)?

With ui-router I can use $state.go('^') to go to parent state without having to specify it's full path. Is there similar way to go to grandparent state (my parent state is abstract)?

文档示例 我只能看到父级的 ^,但也许有人对此有好的解决方案?

In documentation examples I can see only ^ for parent, but maybe someone has good solution for this?

推荐答案

您可以使用

$state.go('^.^')

这篇关于使用 ui-router 进入祖父母状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆