search

Home  >  Q&A  >  body text

angular.js - How to get the url of the previous page in angular

I want to know which page the current page was jumped from. What should I do? I used ui-router to print out $state but I couldn’t find any relevant content

为情所困为情所困2787 days ago619

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-15 16:53:46

        rootScope.$on('$stateChangeSuccess', function (ev, to, toParams, from, fromParams) {
            $rootScope.previousState = from;
            $rootScope.previousParams = fromParams;
        });
    

    reply
    0
  • 迷茫

    迷茫2017-05-15 16:53:46

    $state.current

    reply
    0
  • Cancelreply