AngularJs UI router - one state with multiple URLs

前端 未结 5 927
醉话见心
醉话见心 2020-12-28 13:58

I have a request to add in another URL parameter that directs to a state that I already have set up. For efficiency purposes, I\'m trying to see if I can add multiple URLs t

5条回答
  •  庸人自扰
    2020-12-28 14:36

    You use params:

    https://github.com/angular-ui/ui-router/wiki/URL-Routing

    .state('site.link',
    {
        url: '/{link}'
        ..
    }
    

    so when you use the same state like this

    $state.go('site.link', {link: 'link1'})
    $state.go('site.link', {link: 'link2'})
    

提交回复
热议问题