Angular 5: remove route history

前端 未结 2 845
终归单人心
终归单人心 2020-12-16 09:48

In my app I have a category page that has links to a various product list pages. If it turns out that when you get to a product list page there is only one product then it

相关标签:
2条回答
  • 2020-12-16 10:38

    You can use angular routers replaceUrl flag to do this. See api docs for more details here

    this.router.navigate(['/view'], { replaceUrl: true });
    
    0 讨论(0)
  • 2020-12-16 10:38

    If using the $location object in order to switch views, a way of doing the same as in @alt255 's post is by using the replace() method after calling path("..."):

    $location.path("/").replace();
    
    0 讨论(0)
提交回复
热议问题