title: AngularJS: Get query string values without a hash in the link
body: <p>I am trying to get query string values using angularjs. </p>
  
  <p>my Url: <code>http://localhost/example.php?sportsId=3</code></p>
  
  <p>when I applied <code>var goto = $location.search()['sportsId'];</code>
  it returns me undefined.</p>
  
  <p>However, if I add hash in url like <code>Url: http://localhost/example.php#?sportsId=3</code></p>
  
  <p>then it returns me correct value 3.</p>
  
  <p>But in this case, it also gives me <code>Error: [$parse:syntax] http://errors.angularjs.org/1.3.8/$parse/syntax?p0=undefined&amp;p1=not%20a%20primary%20expression&amp;p2=null&amp;p3=sportsID%3D&amp;p4=sportsID%3D</code></p>
  
  <p>Also, my default <code>$_REQUEST['sportsId']</code> is not working with hash format.</p>
  
  <p>How can I correctly get values from query string by using angularjs?</p>