mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-14 09:43:12 +00:00
docs($rootScope): rearrange event listener docs
This commit is contained in:
parent
ce3b616432
commit
3178afbf0c
1 changed files with 4 additions and 4 deletions
|
|
@ -619,10 +619,6 @@ function $RootScopeProvider(){
|
||||||
* Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for discussion of
|
* Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for discussion of
|
||||||
* event life cycle.
|
* 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
|
* The event listener function format is: `function(event, args...)`. The `event` object
|
||||||
* passed into the listener has the following attributes:
|
* passed into the listener has the following attributes:
|
||||||
*
|
*
|
||||||
|
|
@ -633,6 +629,10 @@ function $RootScopeProvider(){
|
||||||
* propagation (available only for events that were `$emit`-ed).
|
* propagation (available only for events that were `$emit`-ed).
|
||||||
* - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag to true.
|
* - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag to true.
|
||||||
* - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.
|
* - `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) {
|
$on: function(name, listener) {
|
||||||
var namedListeners = this.$$listeners[name];
|
var namedListeners = this.$$listeners[name];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue