mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-06 22:35:22 +08:00
docs($rootScope): rearrange event listener docs
This commit is contained in:
@@ -619,10 +619,6 @@ function $RootScopeProvider(){
|
||||
* Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for discussion of
|
||||
* event life cycle.
|
||||
*
|
||||
* @param {string} name Event name to listen on.
|
||||
* @param {function(event, args...)} listener Function to call when the event is emitted.
|
||||
* @returns {function()} Returns a deregistration function for this listener.
|
||||
*
|
||||
* The event listener function format is: `function(event, args...)`. The `event` object
|
||||
* passed into the listener has the following attributes:
|
||||
*
|
||||
@@ -633,6 +629,10 @@ function $RootScopeProvider(){
|
||||
* propagation (available only for events that were `$emit`-ed).
|
||||
* - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag to true.
|
||||
* - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.
|
||||
*
|
||||
* @param {string} name Event name to listen on.
|
||||
* @param {function(event, args...)} listener Function to call when the event is emitted.
|
||||
* @returns {function()} Returns a deregistration function for this listener.
|
||||
*/
|
||||
$on: function(name, listener) {
|
||||
var namedListeners = this.$$listeners[name];
|
||||
|
||||
Reference in New Issue
Block a user