javascript - AngularJS $stateParams when using reloadOnSearch:false -


I have an application that uses search so I "realoadOnSearch: incorrect" which works completely

I have a problem when navigating with a different state in the same situation:

When I < It works fine em> # / category / 20 / from any other page ... then I have # / category / 3 on that page Link is (original category for 20) and URL update, though content (a E console error)

app.js (main application)

  .state ('category', {Url: '/ category /: categoryId /', templateUrl: '/ home / category', administrator: 'categoryCtrl', reload on search: false})  

To force target = "_self" and it does not work

I have also tried watc < Strong> # / category / 3

# / category / 20 (and vice versa) on the new page. Reload and reload the data, where the search no reload the page (later works but not pre)

The URL should be ng- Href is preferred because it is managed by the root controller

Edit:

I did not find any direct solutions, although I did not have to reload on The search has been disabled and my sorting buttons still work, so it is Ray works as just solution.

The problem is that reload on search does not do what you think That it does; This is actually more like the reloadOnestate Parameters . Setting it to false will save you from making changes in the state, where only stateParams changes, that you are doing here ( # / category / 3 From

You can see it on the pages of UI Router Issues:

There are some functions, but none of these is great, you can probably do ng-click Using the best is to manually reload the load, something like this:

  $ state.transitionTo ($ State.current, $ stateParams, {reload: true, inherit: wrong, notify: true});  

Comments