From 3d21b345866f2a3dbd88b063dd3c64cdf19eab59 Mon Sep 17 00:00:00 2001 From: Valentyn Shybanov Date: Wed, 16 Oct 2013 01:48:35 +0300 Subject: [PATCH] docs($location): add documentation of $location's events Added documentation for $locationChangeStart and $locationChangeSuccess Closes #1569 --- src/ng/location.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/ng/location.js b/src/ng/location.js index 5268bc04b8cd..af919ccddafe 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -516,6 +516,34 @@ function $LocationProvider(){ return html5Mode; } }; + + /** + * @ngdoc event + * @name ng.$location#$locationChangeStart + * @eventOf ng.$location + * @eventType broadcast on root scope + * @description + * Broadcasted before a URL will change. This change can be prevented by calling + * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more + * details about event object. Upon successful change {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired. + * + * @param {Object} angularEvent Synthetic event object. + * @param {string} newUrl New URL + * @param {string=} oldUrl URL that was before it was changed. + */ + + /** + * @ngdoc event + * @name ng.$location#$locationChangeSuccess + * @eventOf ng.$location + * @eventType broadcast on root scope + * @description + * Broadcasted after a URL was changed. + * + * @param {Object} angularEvent Synthetic event object. + * @param {string} newUrl New URL + * @param {string=} oldUrl URL that was before it was changed. + */ this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', function( $rootScope, $browser, $sniffer, $rootElement) {