Maison  >  Questions et réponses  >  le corps du texte

angular.js - angular怎么获取前一个页面的url

想知道当前页面是由哪个页面跳过来的,应该怎么做呢?我用ui-router,把$state打印出来但是没有找到相关的内容诶

为情所困为情所困2713 Il y a quelques jours563

répondre à tous(2)je répondrai

  • PHP中文网

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

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

    répondre
    0
  • 迷茫

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

    $state.current

    répondre
    0
  • Annulerrépondre