Emitting a Custom Event to the Parent Scope Hierarchy

To emit an event from a scope, you use the $emit() method. This method sends an event upward through the parent scope hierarchy. Any ancestor scopes that have registered for the event are notified. The $emit() method uses the following syntax, where name is the event name and args is zero or more arguments to pass to the event handler functions:

scope.$emit(name, [args, . . .])

Get Learning AngularJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.