Skip to content

Commit fefe9f1

Browse files
committed
angular.d.ts - added JSDoc for $broadcast and $emit
1 parent 68114f9 commit fefe9f1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

angularjs/angular.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,29 @@ declare module angular {
539539
$applyAsync(exp: string): any;
540540
$applyAsync(exp: (scope: IScope) => any): any;
541541

542+
/**
543+
* Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope.Scope listeners.
544+
*
545+
* The event life cycle starts at the scope on which $broadcast was called. All listeners listening for name event on this scope get notified. Afterwards, the event propagates to all direct and indirect scopes of the current scope and calls all registered listeners along the way. The event cannot be canceled.
546+
*
547+
* Any exception emitted from the listeners will be passed onto the $exceptionHandler service.
548+
*
549+
* @param name Event name to broadcast.
550+
* @param args Optional one or more arguments which will be passed onto the event listeners.
551+
*/
542552
$broadcast(name: string, ...args: any[]): IAngularEvent;
543553
$destroy(): void;
544554
$digest(): void;
555+
/**
556+
* Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners.
557+
*
558+
* The event life cycle starts at the scope on which $emit was called. All listeners listening for name event on this scope get notified. Afterwards, the event traverses upwards toward the root scope and calls all registered listeners along the way. The event will stop propagating if one of the listeners cancels it.
559+
*
560+
* Any exception emitted from the listeners will be passed onto the $exceptionHandler service.
561+
*
562+
* @param name Event name to emit.
563+
* @param args Optional one or more arguments which will be passed onto the event listeners.
564+
*/
545565
$emit(name: string, ...args: any[]): IAngularEvent;
546566

547567
$eval(): any;

0 commit comments

Comments
 (0)