How to get the Previous State with Params using ui-router

后端 未结 2 1232
生来不讨喜
生来不讨喜 2021-02-04 18:35

Problem Statement :

I have a button \"add comment\" , I should be able to add comment only when i have logged into the system.

But problem is I cannot come back

2条回答
  •  广开言路
    2021-02-04 19:14

    For ui-router v1.0.0+, state change events have been deprecated.

    An updated version of Arjun's state change listener would be

    $transitions.onStart({}, function (transition) {
        $rootScope.previousState = transition.from();
    });
    

提交回复
热议问题