Interface Model<T>


@JsType(isNative=true, name="ng.Model", namespace="<global>") public interface Model<T>
Public AngularTS Model contract exposed through the global ng namespace for Closure-annotated applications.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    TypeScript callback contract for this method.
    static interface 
     
    static interface 
     
    static interface 
     
    static interface 
    TypeScript callback contract for this method.
    static interface 
    TypeScript callback contract for this method.
    static interface 
    TypeScript callback contract for this method.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    Runs synchronous scope mutations as one batch.
    broadcast(String name, Object... var_args)
    Broadcasts an event downward through the scope hierarchy.
    default boolean
    deleteProperty(jsinterop.base.JsPropertyMap<Object> target, double property)
    Public Model.deleteProperty member exposed by the AngularTS namespace contract.
    default boolean
    deleteProperty(jsinterop.base.JsPropertyMap<Object> target, Object property)
    Public Model.deleteProperty member exposed by the AngularTS namespace contract.
    default boolean
    deleteProperty(jsinterop.base.JsPropertyMap<Object> target, String property)
    Public Model.deleteProperty member exposed by the AngularTS namespace contract.
    boolean
    deleteProperty(jsinterop.base.JsPropertyMap<Object> target, Model.DeletePropertyPropertyUnionType property)
    Public Model.deleteProperty member exposed by the AngularTS namespace contract.
    void
    Destroys this scope and its descendants.
    emit(String name, Object... var_args)
    Emits an event upward through the scope hierarchy.
    default Object
    get(jsinterop.base.JsPropertyMap<Object> target, double property, Scope proxy)
    Intercepts property access on the target object.
    default Object
    get(jsinterop.base.JsPropertyMap<Object> target, Object property, Scope proxy)
    Intercepts property access on the target object.
    default Object
    get(jsinterop.base.JsPropertyMap<Object> target, String property, Scope proxy)
    Intercepts property access on the target object.
    get(jsinterop.base.JsPropertyMap<Object> target, Model.GetPropertyUnionType property, Scope proxy)
    Intercepts property access on the target object.
    default Scope
    getById(double id)
    Searches this scope tree for a scope with the given id.
    default Scope
    Searches this scope tree for a scope with the given id.
    Searches this scope tree for a scope with the given id.
    double
    Public Model.id member exposed by the AngularTS namespace contract.
    Public Model.parent member exposed by the AngularTS namespace contract.
    Public Model.root member exposed by the AngularTS namespace contract.
    Public Model.scopeName member exposed by the AngularTS namespace contract.
    void
    merge(Object newTarget)
    Merges enumerable properties from the provided object into the current scope target.
    new_(Scope childInstance)
    Creates a prototypically inherited child scope.
    newIsolate(Scope instance)
    Creates an isolate child scope that does not inherit watchable properties directly.
    Registers an event listener on this scope and returns a deregistration function.
    void
    restore(T snapshot, ModelRestoreOptions options)
    Public Model.restore member exposed by the AngularTS namespace contract.
    Searches the scope tree for a scope registered under the provided name.
    boolean
    set(jsinterop.base.JsPropertyMap<Object> target, String property, Object value, Scope proxy)
    Intercepts and handles property assignments on the target object.
    void
    setId(double id)
    Public Model.id member exposed by the AngularTS namespace contract.
    void
    setParent(Scope parent)
    Public Model.parent member exposed by the AngularTS namespace contract.
    void
    setRoot(Scope root)
    Public Model.root member exposed by the AngularTS namespace contract.
    void
    setScopeName(String scopeName)
    Public Model.scopeName member exposed by the AngularTS namespace contract.
    Public Model.snapshot member exposed by the AngularTS namespace contract.
    sync(Object target, ModelSyncOptions options)
    Public Model.sync member exposed by the AngularTS namespace contract.
    transcluded(Scope parentInstance)
    Creates a transcluded child scope linked to this scope and an optional parent instance.
    watch(String watchProp, Model.WatchListener listenerFn, boolean lazy, boolean directLeaf)
    Registers a watcher for a property along with a listener function.
  • Method Details

    • batch

      <T> T batch(Model.BatchListener<T> fn)
      Runs synchronous scope mutations as one batch. Listener notifications are queued while the callback runs and flushed once after the outermost batch exits. Mutations are not rolled back if the callback throws.
      Parameters:
      fn - Value supplied for the fn parameter.
      Returns:
      Method result.
    • broadcast

      ScopeEvent broadcast(String name, Object... var_args)
      Broadcasts an event downward through the scope hierarchy.
      Parameters:
      name - Value supplied for the name parameter.
      var_args - Value supplied for the args parameter.
      Returns:
      Method result.
    • deleteProperty

      boolean deleteProperty(jsinterop.base.JsPropertyMap<Object> target, Model.DeletePropertyPropertyUnionType property)
      Public Model.deleteProperty member exposed by the AngularTS namespace contract.
      Parameters:
      target - The target object.
      property - The name of the property being deleted.
      Returns:
      Method result.
    • deleteProperty

      @JsOverlay default boolean deleteProperty(jsinterop.base.JsPropertyMap<Object> target, Object property)
      Public Model.deleteProperty member exposed by the AngularTS namespace contract.
      Parameters:
      target - The target object.
      property - The name of the property being deleted.
      Returns:
      Method result.
    • deleteProperty

      @JsOverlay default boolean deleteProperty(jsinterop.base.JsPropertyMap<Object> target, String property)
      Public Model.deleteProperty member exposed by the AngularTS namespace contract.
      Parameters:
      target - The target object.
      property - The name of the property being deleted.
      Returns:
      Method result.
    • deleteProperty

      @JsOverlay default boolean deleteProperty(jsinterop.base.JsPropertyMap<Object> target, double property)
      Public Model.deleteProperty member exposed by the AngularTS namespace contract.
      Parameters:
      target - The target object.
      property - The name of the property being deleted.
      Returns:
      Method result.
    • destroy

      void destroy()
      Destroys this scope and its descendants.
    • emit

      ScopeEvent emit(String name, Object... var_args)
      Emits an event upward through the scope hierarchy.
      Parameters:
      name - Value supplied for the name parameter.
      var_args - Value supplied for the args parameter.
      Returns:
      Method result.
    • get

      Object get(jsinterop.base.JsPropertyMap<Object> target, Model.GetPropertyUnionType property, Scope proxy)
      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 - The target object.
      property - The name of the property being accessed.
      proxy - The proxy object being invoked.
      Returns:
      Method result.
    • get

      @JsOverlay default Object get(jsinterop.base.JsPropertyMap<Object> target, Object property, Scope proxy)
      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 - The target object.
      property - The name of the property being accessed.
      proxy - The proxy object being invoked.
      Returns:
      Method result.
    • get

      @JsOverlay default Object get(jsinterop.base.JsPropertyMap<Object> target, String property, Scope proxy)
      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 - The target object.
      property - The name of the property being accessed.
      proxy - The proxy object being invoked.
      Returns:
      Method result.
    • get

      @JsOverlay default Object get(jsinterop.base.JsPropertyMap<Object> target, double property, Scope proxy)
      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 - The target object.
      property - The name of the property being accessed.
      proxy - The proxy object being invoked.
      Returns:
      Method result.
    • getById

      Searches this scope tree for a scope with the given id.
      Parameters:
      id - Value supplied for the id parameter.
      Returns:
      Method result.
    • getById

      @JsOverlay default Scope getById(String id)
      Searches this scope tree for a scope with the given id.
      Parameters:
      id - Value supplied for the id parameter.
      Returns:
      Method result.
    • getById

      @JsOverlay default Scope getById(double id)
      Searches this scope tree for a scope with the given id.
      Parameters:
      id - Value supplied for the id parameter.
      Returns:
      Method result.
    • getId

      @JsProperty double getId()
      Public Model.id member exposed by the AngularTS namespace contract.
    • getParent

      @JsProperty Scope getParent()
      Public Model.parent member exposed by the AngularTS namespace contract.
    • getRoot

      @JsProperty Scope getRoot()
      Public Model.root member exposed by the AngularTS namespace contract.
    • getScopeName

      @JsProperty String getScopeName()
      Public Model.scopeName member exposed by the AngularTS namespace contract.
    • merge

      void merge(Object newTarget)
      Merges enumerable properties from the provided object into the current scope target.
      Parameters:
      newTarget - Value supplied for the newTarget parameter.
    • newIsolate

      Scope newIsolate(Scope instance)
      Creates an isolate child scope that does not inherit watchable properties directly.
      Parameters:
      instance - Value supplied for the instance parameter.
      Returns:
      Method result.
    • new_

      @JsMethod(name="new") Scope new_(Scope childInstance)
      Creates a prototypically inherited child scope.
      Parameters:
      childInstance - Value supplied for the childInstance parameter.
      Returns:
      Method result.
    • on

      Registers an event listener on this scope and returns a deregistration function.
      Parameters:
      name - Value supplied for the name parameter.
      listener - Value supplied for the listener parameter.
      Returns:
      Method result.
    • restore

      void restore(T snapshot, ModelRestoreOptions options)
      Public Model.restore member exposed by the AngularTS namespace contract.
      Parameters:
      snapshot - Value supplied for the snapshot parameter.
      options - Value supplied for the options parameter.
    • searchByName

      Scope searchByName(String name)
      Searches the scope tree for a scope registered under the provided name.
      Parameters:
      name - Value supplied for the name parameter.
      Returns:
      Method result.
    • set

      boolean set(jsinterop.base.JsPropertyMap<Object> target, String property, Object value, Scope proxy)
      Intercepts and handles property assignments on the target object. Scopeable objects are stored as raw model values and proxied lazily when read.
      Parameters:
      target - The target object.
      property - The name of the property being set.
      value - The new value being assigned to the property.
      proxy - The proxy intercepting property access.
      Returns:
      Method result.
    • setId

      @JsProperty void setId(double id)
      Public Model.id member exposed by the AngularTS namespace contract.
    • setParent

      @JsProperty void setParent(Scope parent)
      Public Model.parent member exposed by the AngularTS namespace contract.
    • setRoot

      @JsProperty void setRoot(Scope root)
      Public Model.root member exposed by the AngularTS namespace contract.
    • setScopeName

      @JsProperty void setScopeName(String scopeName)
      Public Model.scopeName member exposed by the AngularTS namespace contract.
    • snapshot

      T snapshot()
      Public Model.snapshot member exposed by the AngularTS namespace contract.
      Returns:
      Method result.
    • sync

      Model.Subscription sync(Object target, ModelSyncOptions options)
      Public Model.sync member exposed by the AngularTS namespace contract.
      Parameters:
      target - Value supplied for the target parameter.
      options - Value supplied for the options parameter.
      Returns:
      Method result.
    • transcluded

      Scope transcluded(Scope parentInstance)
      Creates a transcluded child scope linked to this scope and an optional parent instance.
      Parameters:
      parentInstance - Value supplied for the parentInstance parameter.
      Returns:
      Method result.
    • watch

      Model.Subscription watch(String watchProp, Model.WatchListener listenerFn, boolean lazy, boolean directLeaf)
      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 - An expression to be watched in the context of this model.
      listenerFn - A function to execute when changes are detected on watched context.
      lazy - A flag to indicate if the listener should be invoked immediately. Defaults to false.
      directLeaf - Value supplied for the directLeaf parameter.
      Returns:
      Method result.