后退按钮没有使用angularjs做任何事情

时间:2022-10-29 19:40:40

This is how I specify my route.

这是我指定路线的方式。

.state('app.partners', {
        url:'/partners',
        templateUrl: 'partials/dashboard/partners.html'
      })
      .state('app.partners.id', {
        url:'/:id',
        templateUrl: 'partials/dashboard/partners.html'
      })

Then I do this in my controller

然后我在我的控制器中执行此操作

$state.go('app.partner.id',{id:partnerId});
    $http.get('/app/endpoint?id='+$state.params.id || null).then(function(response){
//do something
});

I manage to see the browser url changed but when I click back, nothing happens?

我设法看到浏览器网址已更改,但是当我点击后退时,没有任何反应?

1 个解决方案

#1


0  

You probably have an error in your console that's causing the back button to break.

您的控制台中可能有一个错误导致后退按钮中断。

Also, you call $state.go() with app.partner.id (singular) but you defined your route as app.partners.id (plural)

此外,您使用app.partner.id(单数)调用$ state.go(),但您将路由定义为app.partners.id(复数)

#1


0  

You probably have an error in your console that's causing the back button to break.

您的控制台中可能有一个错误导致后退按钮中断。

Also, you call $state.go() with app.partner.id (singular) but you defined your route as app.partners.id (plural)

此外,您使用app.partner.id(单数)调用$ state.go(),但您将路由定义为app.partners.id(复数)