0

I'm creating a simple angularjs app and want to read the query parameters of the url mypath.com/test.html?param1=test.

Question: how can I read and modify the parameters list?

$location.search() does not return any results here.

3
  • so what does $location.search() return? Commented Jan 13, 2016 at 11:28
  • [Object object] that cannot be inspected. Commented Jan 13, 2016 at 11:29
  • and what if you console.log(Object.keys($location.search())) ? Commented Jan 13, 2016 at 11:30

1 Answer 1

1

I think you must activate the html5Mode before calling : $location.search()

$locationProvider.html5Mode(true);
Sign up to request clarification or add additional context in comments.

1 Comment

Could you add an example how to use the url with # when referencing on a test.html directly? That sounds promising.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.