Is there a reason you can't use the $location service with html5 mode
enabled?


On Thu, Jun 12, 2014 at 6:21 AM, hyperN <[email protected]> wrote:

> I have problem using HTML 5 History API with Angular:
>
>     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"]]
>
> 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:
>
> setTimeout(function() {
>             history.pushState({}, "progress", url);
>         },1000);
>
> One user mentioned that this worked for him also:
>
> $browser.url( state.url );
> history.replaceState({}, state.title, state.url );
>
> But no luck for me. $browser is Angular's private API which $location
> uses, interesting thing is that if I do smth. like this:
>
>   var url = $browser.url() + "/progress";
>   $browser.url(url,true);
>   console.log(window.location.href);
>
> 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)
>
> Could this be due to my server side routing configuration ? (I'm using
> ASP.net <http://asp.net/> MVC).
>
> My question is, has anyone alse had any luck with $browser or found
> solution to this problem other than setTimeout ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
chrisrhoden

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to