If you are using ui-router , which is highly recommended, you can use $state.go(to, params, options) as described here .
As a prerequisite, you need to correctly determine your state, which means that every possible request parameter must be known by ui-router. See the following example ( page and otherParam ):
$stateProvider. state('storeItems', { url: '/store/items?page&otherParam', templateUrl: '/modules/store/views/item.client.view.html' });
And then you can simply switch places for the instance from the controller by calling
$scope.gotoItemsPage = function(page) { $state.go('storeItems', { page: page, otherParam: 'Just a show off' }); };
No coding required and readable!
aaki Jan 04 '15 at 17:30 2015-01-04 17:30
source share