MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / setBrowserUrlWithFallback

Function setBrowserUrlWithFallback

lib/test/angular/1.5.0/angular.js:12930–12947  ·  view source on GitHub ↗
(url, replace, state)

Source from the content-addressed store, hash-verified

12928 var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i;
12929
12930 function setBrowserUrlWithFallback(url, replace, state) {
12931 var oldUrl = $location.url();
12932 var oldState = $location.$$state;
12933 try {
12934 $browser.url(url, replace, state);
12935
12936 // Make sure $location.state() returns referentially identical (not just deeply equal)
12937 // state object; this makes possible quick checking if the state changed in the digest
12938 // loop. Checking deep equality would be too expensive.
12939 $location.$$state = $browser.state();
12940 } catch (e) {
12941 // Restore old values if pushState fails
12942 $location.url(oldUrl);
12943 $location.$$state = oldState;
12944
12945 throw e;
12946 }
12947 }
12948
12949 $rootElement.on('click', function(event) {
12950 // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)

Callers 1

$LocationProviderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected