(url, replace, state)
| 12500 | var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i; |
| 12501 | |
| 12502 | function setBrowserUrlWithFallback(url, replace, state) { |
| 12503 | var oldUrl = $location.url(); |
| 12504 | var oldState = $location.$$state; |
| 12505 | try { |
| 12506 | $browser.url(url, replace, state); |
| 12507 | |
| 12508 | // Make sure $location.state() returns referentially identical (not just deeply equal) |
| 12509 | // state object; this makes possible quick checking if the state changed in the digest |
| 12510 | // loop. Checking deep equality would be too expensive. |
| 12511 | $location.$$state = $browser.state(); |
| 12512 | } catch (e) { |
| 12513 | // Restore old values if pushState fails |
| 12514 | $location.url(oldUrl); |
| 12515 | $location.$$state = oldState; |
| 12516 | |
| 12517 | throw e; |
| 12518 | } |
| 12519 | } |
| 12520 | |
| 12521 | $rootElement.on('click', function(event) { |
| 12522 | // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) |
no test coverage detected