How do I extract query parameters using ui-router for AngularJS?
In AngularJS' own $location
service I did:
($location.search()).uid
to extract the parameter uid from a URL. What is the corresponding code for ui-router?
angular-uiangular-ui-routerangularjsjavascriptquery-parameters
How do I extract query parameters using ui-router for AngularJS?
In AngularJS' own $location
service I did:
($location.search()).uid
to extract the parameter uid from a URL. What is the corresponding code for ui-router?
Best Answer
See the query parameters section of the URL routing documentation.
For this example, if the url is
/contacts?myParam=value
then the value of$state.params
will be: