title: AngularJs and HTML 5 history API not working
body: <p>I have problem using HTML 5 History API with Angular:</p>
  
  <pre><code>    Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
  Watchers fired in the last 5 iterations: [["fn: $locationWatch; newVal: 8; oldVal: 7"],["fn: $locationWatch; newVal: 9; oldVal: 8"],["fn: $locationWatch; newVal: 10; oldVal: 9"],["fn: $locationWatch; newVal: 11; oldVal: 10"],["fn: $locationWatch; newVal: 12; oldVal: 11"]]
  </code></pre>
  
  <p>Then I've searched for solution and  I've found out that this is known problem. Only "solution" I've managed to find, which worked, was wrapping history API inside setTimeout function, smth. like this:</p>
  
  <pre><code>setTimeout(function() {
              history.pushState({}, "progress", url);
          },1000);
  </code></pre>
  
  <p>One user mentioned that this worked for him also:</p>
  
  <pre><code>$browser.url( state.url );
  history.replaceState({}, state.title, state.url );
  </code></pre>
  
  <p>But no luck for me. $browser is Angular's private API which $location uses, interesting thing is that if I do smth. like this:</p>
  
  <pre><code>  var url = $browser.url() + "/progress";
    $browser.url(url,true);
    console.log(window.location.href);
  </code></pre>
  
  <p>My new url is logged but I don't see changes in address  bar i.e.  $browser.url() is shown. (in Chorme this proggres is shown for brief second then it disappears)</p>
  
  <p>Could this be due to my server side routing configuration ? (I'm using ASP.net MVC).</p>
  
  <p>My question is, has anyone alse had any luck with $browser or found solution to this problem other than setTimeout ? </p>