Im accessing this url: http://bazarak.af/#!/annonser/page=1&...
.when("/annonser/:query",{
templateUrl: '/views/search.php',
controller: "Search"
})
I would like to get the value of page and change it both in the url and in the routeParams.
To get the page value I have tried
var pageNumber = $routeParams.page;
and to set it I have tried:
$routeParams ==> {page:5}
None of this works. And the documentation is not really helping me. How can I do this?
Use $location.path() to set new URL path. It will be reflected in routes as well. You can also just change $location.search to change your query Read this documentation http://docs.angularjs.org/guide/dev_guide.services.$location