Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 64
  • Last Modified:

How to retrieve query string values from url in Angular JS

Hi,
I am trying to get the query string parameter values from url in Angular JS. 4location.search().parametername is not working.
Can I get any simple to understand example.

Thanks
0
KavyaVS
Asked:
KavyaVS
  • 2
  • 2
2 Solutions
 
BigRatCommented:
Where? Is this server side or in an HTML page which when loaded uses Angular?
0
 
KavyaVSAuthor Commented:
In an Html page  when loaded using Angular. Thanks
0
 
BigRatCommented:
I'm really sorry for having being so busy this week that I forgot all about you. Give youself the points.

The service you need to inject is $location. The method search() will return a Javascript object with the parameters of the URL.

https://docs.angularjs.org/api/ng/service/$location

HTH
0
 
KavyaVSAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now