title: How to get url parameter in angularjs?
body: <p>I have been trying to get the url parameter in Angular, but this is not a Single Page application. I tried the below code snippet.</p>
  
  <pre><code>www.example.com?param1=ABC
  </code></pre>
  
  <p>Injected <code>$location</code> in controller, then</p>
  
  <pre><code>var paramValue= $location.search().param1;
  </code></pre>
  
  <p>In the above case, paramValue is undefined. But, If I change the url to</p>
  
  <p><code>www.example.com#?param1=ABC</code>  (Added # in the URL) it works.</p>
  
  <p>But, I don't want to do this because it breaks the page since it is not SPA.</p>
  
  <p>Can someone suggest a better way to get the url parameter without using # in the url?</p>