Using Angular's $location.search()
method, it is possible to create a URL parameter, like this:
Is it possible to create multiple URL parameters, like this?
;param2=myParam2&...
I've tried adding multiple object parameters to the function call (ex. $location.search({ key1: value, key2: value })
), but I'm only receiving one key/value in the URL.
Thanks!
Using Angular's $location.search()
method, it is possible to create a URL parameter, like this:
http://mysite.com/page?param=myParam
Is it possible to create multiple URL parameters, like this?
http://mysite.com/page?param=myParam¶m2=myParam2&...
I've tried adding multiple object parameters to the function call (ex. $location.search({ key1: value, key2: value })
), but I'm only receiving one key/value in the URL.
Thanks!
Share Improve this question asked May 13, 2013 at 7:33 user677526user6775261 Answer
Reset to default 17It does work in this fiddle: http://jsfiddle.net/PHnLb/42/
$scope.changeTarget = function(name) {
$location.search({target : 'Hi', new : 'else'});
}
(Angular 1.1.4, HTML5 mode = true)
Which version of angular are you using?