• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 56
  • 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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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