From b86a44cca52f14b3c565f09b2d5184e68f8a5605 Mon Sep 17 00:00:00 2001 From: Gias Kay Lee Date: Tue, 9 Jul 2013 22:25:51 +0800 Subject: [PATCH] Add transitionToParent() method --- src/state.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/state.js b/src/state.js index 7a6821e82..f5d138caa 100644 --- a/src/state.js +++ b/src/state.js @@ -258,6 +258,10 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) { return transition; }; + $state.transitionToParent = function() { + return $state.transitionTo($state.$current.parent.self.name); + }; + $state.is = function (stateOrName) { return $state.$current === findState(stateOrName); };