$emit
( type in module ng
)
Dispatches an event name upwards through the scope hierarchy notifying the
registered ng.$rootScope.Scope#$on listeners.
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.
Any exception emitted from the listeners will be passed
onto the $exceptionHandler service.
Scope#$emit(name, args);
name – {string} –
Event name to emit.
args – {...*} –
Optional set of arguments which will be passed onto the event listeners.
{Object}
– Event object, see ng.$rootScope.Scope#$on