AngularTS
    Preparing search index...

    Class Scope

    Scope class for the Proxy. It intercepts operations like property access (get) and property setting (set), and adds support for deep change tracking and observer-like behavior.

    Index

    Constructors

    • Initializes the handler with the target object and a context.

      Parameters

      • Optionalcontext: Scope

        The context containing listeners.

      • Optionalparent: Scope

        Custom parent.

      Returns Scope

    Properties

    $$asyncQueue: AsyncQueueTask[]
    $$destroyed: boolean
    $$listeners: Map<string, Function[]>
    $children: Scope[]
    $handler: Scope
    $id: number
    $parent: Scope
    $proxy: any

    Current proxy being operated on

    $root: Scope
    $target: any
    $value: any
    context: Scope
    filters: any[]
    foreignListeners: Map<string, Listener[]>
    foreignProxies: Set<ProxyConstructor>
    functionListeners: Map<Function, { fn: Function; oldValue: any }>
    objectListeners: WeakMap<any, string[]>
    scheduled: any[]
    watchers: Map<string, Listener[]>

    Methods

    • Parameters

      • expr: string

      Returns any

    • Parameters

      • name: string
      • ...args: any[]

      Returns any

    • Returns void

    • Parameters

      • name: string
      • ...args: any[]

      Returns void

    • Parameters

      • expr: any
      • locals: any

      Returns any

    • Returns void

    • Searches the scope instance

      Parameters

      • id: string | number

      Returns Scope

    • Parameters

      • newTarget: any

      Returns void

    • Parameters

      • childInstance: any

      Returns any

    • Parameters

      • instance: any

      Returns any

    • Parameters

      • name: string
      • listener: Function

      Returns any

    • Parameters

      • fn: Function

      Returns void

    • Parameters

      • parentInstance: any

      Returns any

    • Registers a watcher for a property along with a listener function. The listener function is invoked when changes to that property are detected.

      Parameters

      • watchProp: string

        An expression to be watched in the context of this model.

      • OptionallistenerFn: ListenerFunction

        A function to execute when changes are detected on watched context.

      • Optionallazy: boolean = false

        A flag to indicate if the listener should be invoked immediately. Defaults to false.

      Returns () => void

    • Parameters

      • target: any
      • property: any

      Returns boolean

    • Parameters

      • key: any
      • id: any

      Returns boolean

    • Intercepts property access on the target object. It checks for specific properties (watch and sync) and binds their methods. For other properties, it returns the value directly.

      Parameters

      • target: any

        The target object.

      • property: string | number | symbol

        The name of the property being accessed.

      • proxy: ProxyConstructor

        The proxy object being invoked

      Returns any

      • The value of the property or a method if accessing watch or sync.
    • Intercepts and handles property assignments on the target object. If a new value is an object, it will be recursively proxied.

      Parameters

      • target: any

        The target object.

      • property: string

        The name of the property being set.

      • value: any

        The new value being assigned to the property.

      • proxy: ProxyConstructor

        The proxy intercepting property access

      Returns boolean

      • Returns true to indicate success of the operation.