在ui-routes过渡到祖父州

时间:2015-08-27 05:16:30

标签: angularjs angular-ui-router

有没有办法去祖父州?不使用它的文字名称。

$state.go('^'); // will go to a parent state.
$state.go('^.sibling'); // will go to a sibling state.
$state.go('.child.grandchild'); // will go to a grandchild state.

我需要类似的东西:

$state.go('^.parent'); 

1 个答案:

答案 0 :(得分:1)

这很简单:$state.go('^.^');

他们在图片中的文档网站上使用它,但没有明确地使用它。

此外,它似乎也适用于多个级别:$state.go('^.^.^');