title: How to deal with the URL in Angular?
body: <p>In my application I have a URL like this <code>/customers/details/1</code>. On this page there is a search box. What I want is, when a search is performed, the url must changed to <code>/customers/</code>.</p>
  
  <p>This is what I've tried:</p>
  
  <pre><code>$location.path('/customers');
  
  // call to service with search params and set the result to the customers list (asynchronous)
  </code></pre>
  
  <p>The result is that the URL is changed to <code>/customers</code> but the result of the search is not shown. When I perform the search again, I do get results.</p>
  
  <p>My quess is that the first time, the query get's executed, but because I changed the path, the results are lost.</p>
  
  <p>What I'd like to know is, what can I do, to change the URL and also show the search results in the 'new' URL?</p>