AngularJS ui-router: reload:true also reloads parent state

前端 未结 2 1123
粉色の甜心
粉色の甜心 2021-01-18 02:15

In this plunk you have two ui-router states, a parent and a child. When the child is invoked by clicking on the link, since it has the option reload: true it is

2条回答
  •  旧巷少年郎
    2021-01-18 02:29

    A changing parameter as Mathew Foscarini suggested, is (for sure) way to go. There could be also another solution, technique with state reloader. Below, and in this updated plunker we can see simplified version, but we can even pass some params there to make it more general

    .state('state1.reloader', {
          controller: function($state) {
            $state.go('state1.state11')
          }
    })
    

    And we can call it like:

    // instead of this
    
    // we can do this
    
    

    Check it here

提交回复
热议问题