Solved

How to retrieve query string values from url in Angular JS

Posted on 2016-09-17
4
36 Views
Last Modified: 2016-09-24
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
Comment
Question by:KavyaVS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 27

Assisted Solution

by:BigRat
BigRat earned 500 total points
ID: 41803116
Where? Is this server side or in an HTML page which when loaded uses Angular?
0
 

Author Comment

by:KavyaVS
ID: 41803688
In an Html page  when loaded using Angular. Thanks
0
 
LVL 27

Accepted Solution

by:
BigRat earned 500 total points
ID: 41813656
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
 

Author Closing Comment

by:KavyaVS
ID: 41814109
Thanks
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Angular JS HTTP Post Double Return 5 100
pikaday using angularjs 7 179
Are angular function calls asynchronous 1 53
Regarding issue on passing endpoint into angularjs 10 25
You have this traditional web application that refreshes the whole page each time you navigate and you think it's a good time to convert it to a Single-Page approach. What should you know in advance? Read on, I'll guide you through it.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question