You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
This is a serious bug that causes angular to stop functioning until you refresh the page. This happens any time there is an <ng-view> on the page and an apostrophe in a querystring argument. It happens in Firefox, but it does not happen in Chrome. I'm using Angular 1.0rc6. The error message it produces is below.
Here's the problem. We're comparing location.href to a location constructed from its components. Unfortunately in Firefox the hash part of location.href is not the same as location.hash when any special characters are used. location.href is fully escape()'d, while location.hash is unescape()'d. If you have an apostrophe in your url, angular compares and assigns these values repeatedly and they never become equal.
Okay, it appears apostrophes are the only thing causing the inconsistency. Firefox escapes them and Chrome does not. escape() escapes them and encodeURIComponent and encodeURI do not. To patch up the inconsistency, modify Browser#url like so:
Example:
http://nickretallack.com/experiments/angular/apostrophe.html#/?query=some%27thing
This is a serious bug that causes angular to stop functioning until you refresh the page. This happens any time there is an
<ng-view>
on the page and an apostrophe in a querystring argument. It happens in Firefox, but it does not happen in Chrome. I'm using Angular 1.0rc6. The error message it produces is below.10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [["fn: $locationWatch; newVal: 7; oldVal: 6"],["fn: $locationWatch; newVal: 8; oldVal: 7"],["fn: $locationWatch; newVal: 9; oldVal: 8"],["fn: $locationWatch; newVal: 10; oldVal: 9"],["fn: $locationWatch; newVal: 11; oldVal: 10"]]
Source code for the example program:
The text was updated successfully, but these errors were encountered: