Skip to content

Commit 3d21b34

Browse files
committed
docs($location): add documentation of $location's events
Added documentation for $locationChangeStart and $locationChangeSuccess Closes angular#1569
1 parent dba566a commit 3d21b34

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/ng/location.js

+28
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,34 @@ function $LocationProvider(){
516516
return html5Mode;
517517
}
518518
};
519+
520+
/**
521+
* @ngdoc event
522+
* @name ng.$location#$locationChangeStart
523+
* @eventOf ng.$location
524+
* @eventType broadcast on root scope
525+
* @description
526+
* Broadcasted before a URL will change. This change can be prevented by calling
527+
* `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
528+
* details about event object. Upon successful change {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.
529+
*
530+
* @param {Object} angularEvent Synthetic event object.
531+
* @param {string} newUrl New URL
532+
* @param {string=} oldUrl URL that was before it was changed.
533+
*/
534+
535+
/**
536+
* @ngdoc event
537+
* @name ng.$location#$locationChangeSuccess
538+
* @eventOf ng.$location
539+
* @eventType broadcast on root scope
540+
* @description
541+
* Broadcasted after a URL was changed.
542+
*
543+
* @param {Object} angularEvent Synthetic event object.
544+
* @param {string} newUrl New URL
545+
* @param {string=} oldUrl URL that was before it was changed.
546+
*/
519547

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

0 commit comments

Comments
 (0)