angularjs - What's the difference between $locationChangeSuccess and $locationChangeStart? -



angularjs - What's the difference between $locationChangeSuccess and $locationChangeStart? -

what's difference between $locationchangesuccess , $locationchangestart?

they both undocumented events related window.location.

the $locationchangestart fired when angularjs starts update browser's location based on mutations done via $location service ($location.path(), $location.search()).

it might happen application hear $locationchangestart event , phone call preventdefault() on it. in case sec event ($locationchangesuccess) won't broadcasting.

in short: $locationchangestart fires when location gets updated. followed $locationchangesuccess if first action wasn't prevented.

relevant bits of source code here: https://github.com/angular/angular.js/blob/2508b47c1a34dfc834f8fde858574f81af4d287e/src/ng/location.js#l598

angularjs window.location

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -