Angularjs Go back button doesn't work when using url with query string

Here is my ui-router that works fine:

ngModule.config(['$stateProvider', function ($stateProvider) { $stateProvider .state('homepage', { url: '', templateUrl: '/partials/homepage/' }) .state('item', { url: '/item/:item_id', templateUrl: function ($stateParams) { return '/partials/item/' + $stateParams.item_id + '/'; } }) .state('search', { url: '/search/?q', templateUrl: function ($stateParams) { return '/partials/search/?q=' + $stateParams.q; } }); }]); 

Routing works fine. The only problem is with the state of the search. The browser button in this case does not work. The only difference related to 2 comes from a string query. How can I fix the back button to make it work with a string request?

+5
source share

All Articles