Trait/Object

io.scalajs.npm.angularjs

Scope

Related Docs: object Scope | package angularjs

Permalink

trait Scope extends Object

Represents an AngularJS Scope

Annotations
@RawJSType() @native()
See also

https://docs.angularjs.org/api/ng/type/$rootScope.Scope

Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Scope
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def $apply(exp: Any = js.native): Any

    Permalink

    apply() is used to execute an expression in angular from outside of the angular framework.

    apply() is used to execute an expression in angular from outside of the angular framework. (For example from browser DOM events, setTimeout, XHR or third party libraries). Because we are calling into the angular framework we need to perform proper scope life cycle of exception handling, executing watches.

    exp

    An angular expression to be executed.

    • string: execute using the rules as defined in expression.
    • function(scope): execute the function with current scope parameter.
    returns

    The result of evaluating the expression.

  4. def $applyAsync(exp: Any = js.native): Any

    Permalink

    Schedule the invocation of $apply to occur at a later time.

    Schedule the invocation of $apply to occur at a later time. The actual time difference varies across browsers, but is typically around ~10 milliseconds.

    This can be used to queue up multiple expressions which need to be evaluated in the same digest.

    exp

    An angular expression to be executed.

    • string: execute using the rules as defined in expression.
    • function(scope): execute the function with current scope parameter.
  5. def $broadcast(name: String, args: Any*): Object

    Permalink

    Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope.Scope listeners.

    Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope.Scope listeners.

    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.

    Any exception emitted from the listeners will be passed onto the $exceptionHandler service.

    name

    Event name to broadcast.

    args

    Optional one or more arguments which will be passed onto the event listeners.

  6. def $destroy(): Unit

    Permalink

    Removes the current scope (and all of its children) from the parent scope.

    Removes the current scope (and all of its children) from the parent scope. Removal implies that calls to $digest() will no longer propagate to the current scope and its children. Removal also implies that the current scope is eligible for garbage collection.

    The $destroy() is usually used by directives such as ngRepeat for managing the unrolling of the loop.

    Just before a scope is destroyed, a $destroy event is broadcasted on this scope. Application code can register a $destroy event handler that will give it a chance to perform any necessary cleanup.

    Note that, in AngularJS, there is also a $destroy jQuery event, which can be used to clean up DOM bindings before an element is removed from the DOM.

  7. def $digest(): Unit

    Permalink

    Processes all of the watchers of the current scope and its children.

    Processes all of the watchers of the current scope and its children. Because a watcher's listener can change the model, the $digest() keeps calling the watchers until no more listeners are firing. This means that it is possible to get into an infinite loop. This function will throw 'Maximum iteration limit exceeded.' if the number of iterations exceeds 10.

  8. def $emit(name: String, args: Any*): Object

    Permalink

    Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners.

    Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope 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.

    name

    Event name to emit.

    args

    Optional one or more arguments which will be passed onto the event listeners.

  9. def $eval[T](expression: Any = js.native, locals: Object = js.native): T

    Permalink

    Executes the expression on the current scope and returns the result.

    Executes the expression on the current scope and returns the result. Any exceptions in the expression are propagated (uncaught). This is useful when evaluating Angular expressions.

    expression

    An angular expression to be executed.

    • string: execute using the rules as defined in expression.
    • function(scope): execute the function with the current scope parameter.
    locals

    Local variables object, useful for overriding values in scope.

    returns

    The result of evaluating the expression.

  10. def $evalAsync(expression: Any = js.native, locals: Object = js.native): Unit

    Permalink

    Executes the expression on the current scope at a later point in time.

    Executes the expression on the current scope at a later point in time. The $evalAsync makes no guarantees as to when the expression will be executed, only that:

    • it will execute after the function that scheduled the evaluation (preferably before DOM rendering).
    • at least one $digest cycle will be performed after expression execution.
    expression

    An angular expression to be executed.

    locals

    Local variables object, useful for overriding values in scope.

  11. def $id: Int

    Permalink

    Returns the unique scope ID (monotonically increasing) useful for debugging.

    Returns the unique scope ID (monotonically increasing) useful for debugging.

    returns

    Unique scope ID (monotonically increasing) useful for debugging.

  12. def $new(isolate: Boolean, parent: Scope = js.native): Scope

    Permalink

    Creates a new child scope.

    Creates a new child scope. The parent scope will propagate the $digest() event. The scope can be removed from the scope hierarchy using $destroy(). $destroy() must be called on a scope when it is desired for the scope and its child scopes to be permanently detached from the parent and thus stop participating in model change detection and listener notification by invoking.

    isolate

    If true, then the scope does not prototypically inherit from the parent scope. The scope is isolated, as it can not see parent scope properties. When creating widgets, it is useful for the widget to not accidentally read parent state.

    parent

    The Scope that will be the $parent of the newly created scope. Defaults to this scope if not provided. This is used when creating a transclude scope to correctly place it in the scope hierarchy while maintaining the correct prototypical inheritance.

    returns

    The newly created child scope.

  13. def $on(name: String, listener: Function): Function

    Permalink

    Listens on events of a given type.

    Listens on events of a given type. See $emit for discussion of event life cycle. The event listener function format is: function(event, args...). The event object passed into the listener has the following attributes:

    name

    Event name to listen on.

    listener

    Function to call when the event is emitted.

    returns

    Returns a deregistration function for this listener.

  14. def $parent: Scope

    Permalink

    Returns the reference to the parent scope.

    Returns the reference to the parent scope.

    returns

    Reference to the parent scope.

  15. def $root: Scope

    Permalink

    Returns the reference to the root scope.

    Returns the reference to the root scope.

    returns

    Reference to the root scope.

  16. def $watch(watchExpression: Any, listener: Function = js.native, objectEquality: Boolean = js.native): Function

    Permalink

    Registers a listener callback to be executed whenever the watchExpression changes.

    Registers a listener callback to be executed whenever the watchExpression changes.

    watchExpression

    The watchExpression is called on every call to $digest() and should return the value that will be watched. (Since $digest() reruns when it detects changes the watchExpression can execute multiple times per $digest() and should be idempotent.)

    listener

    The listener is called only when the value from the current watchExpression and the previous call to watchExpression are not equal (with the exception of the initial run, see below). Inequality is determined according to reference inequality, strict comparison via the !== Javascript operator, unless objectEquality == true (see next point)

    objectEquality

    When objectEquality == true, inequality of the watchExpression is determined according to the angular.equals function. To save the value of the object for later comparison, the angular.copy function is used. This therefore means that watching complex objects will have adverse memory and performance implications.

  17. def $watchCollection(obj: Any, listener: Function): Function

    Permalink

    Shallow watches the properties of an object and fires whenever any of the properties change (for arrays, this implies watching the array items; for object maps, this implies watching the properties).

    Shallow watches the properties of an object and fires whenever any of the properties change (for arrays, this implies watching the array items; for object maps, this implies watching the properties). If a change is detected, the listener callback is fired.

    obj

    The obj collection is observed via standard $watch operation and is examined on every call to $digest() to see if any items have been added, removed, or moved.

    listener

    The listener is called whenever anything within the obj has changed. Examples include adding, removing, and moving items belonging to an object or array.

    returns

    Returns a de-registration function for this listener. When the de-registration function is executed, the internal watch operation is terminated.

  18. def $watchGroup(watchExpressions: Array[Any], listener: Function): Function

    Permalink

    A variant of $watch() where it watches an array of watchExpressions.

    A variant of $watch() where it watches an array of watchExpressions. If any one expression in the collection changes the listener is executed.

    watchExpressions

    The items in the watchExpressions array are observed via standard $watch operation and are examined on every call to $digest() to see if any items changes.

    listener

    The listener is called whenever any expression in the watchExpressions array changes.

    returns

    Returns a de-registration function for all listeners.

  19. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  21. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  27. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  30. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  36. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  37. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  38. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped