title: Changing URL without reloading in AngularJS
body: <p>I got a function that changes the URL on button click.</p>
  
  <p>Problem:</p>
  
  <blockquote>
    <p>AngularJS obviously reloads on URL change automatically.</p>
  </blockquote>
  
  <pre><code>var newUrl = ($state.current.url).replace('{navigationId}', $stateParams.navigationId).replace('{tabId}', tab.stateReference);
  history.pushState('', tab.stateReference, newUrl);
  </code></pre>
  
  <p>How can we change the URL without reloading the page in AngularJS?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I tried to use <code>reloadOnSearch: false</code> as described here: <a href="https://docs.angularjs.org/api/ngRoute/provider/" rel="nofollow">https://docs.angularjs.org/api/ngRoute/provider/</a>$routeProvider - but it still reloads the page.</p>