Angular - ui-router get previous state
问题 Is there a way to get the previous state of the current state? For example I would like to know what the previous state was before current state B (where previous state would have been state A). I am not able to find it in ui-router github doc pages. 回答1: ui-router doesn't track the previous state once it transitions, but the event $stateChangeSuccess is broadcast on the $rootScope when the state changes. You should be able to catch the prior state from that event ( from is the state you're