I want to extract my url querystring using $location
like this example.
my url - http://someDomain.com/create/index.jsp?queryToken=123abc
and in my directive:
vm.queryParam = $location.search();
$log.log('vm.queryParam', vm.queryParam); //{}
vm.details.query = vm.queryParam.queryToken;
$log.log('vm.queryToken', vm.details.query); //undefined
I can see the param or params when logging $location
but what is the correct way to extract them when search()
does not work?
Thanks.