Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit dfccdd5

Browse files
olostanpetebacondarwin
authored andcommitted
docs($location): document $location's events
Closes #1569 Closes #4446
1 parent 2cdb588 commit dfccdd5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/ng/location.js

+29
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,35 @@ function $LocationProvider(){
525525
return html5Mode;
526526
}
527527
};
528+
529+
/**
530+
* @ngdoc event
531+
* @name ng.$location#$locationChangeStart
532+
* @eventOf ng.$location
533+
* @eventType broadcast on root scope
534+
* @description
535+
* Broadcasted before a URL will change. This change can be prevented by calling
536+
* `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
537+
* details about event object. Upon successful change
538+
* {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.
539+
*
540+
* @param {Object} angularEvent Synthetic event object.
541+
* @param {string} newUrl New URL
542+
* @param {string=} oldUrl URL that was before it was changed.
543+
*/
544+
545+
/**
546+
* @ngdoc event
547+
* @name ng.$location#$locationChangeSuccess
548+
* @eventOf ng.$location
549+
* @eventType broadcast on root scope
550+
* @description
551+
* Broadcasted after a URL was changed.
552+
*
553+
* @param {Object} angularEvent Synthetic event object.
554+
* @param {string} newUrl New URL
555+
* @param {string=} oldUrl URL that was before it was changed.
556+
*/
528557

529558
this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement',
530559
function( $rootScope, $browser, $sniffer, $rootElement) {

0 commit comments

Comments
 (0)