AngularJS UI-Router : Get the absolute URL of the state with the parameters

前端 未结 3 580
既然无缘
既然无缘 2020-12-24 10:28

I wanted to be able to change the address\' URL without changing the state, as to prevent rerendering. From my search, ui-router currently does not provide this

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 11:05

    For getting the absolute URL without parameters, I'm finding I need to pass inherit: false, eg:

    $state.href('home', {}, {absolute: true, inherit: false})
    

    Without inherit: false I was getting any/all params that may be present.

提交回复
热议问题