Package org.angular.ts.ng
Class Scope
java.lang.Object
org.angular.ts.ng.Scope
Reactive scope object used by AngularTS templates, directives, event propagation, listener registration, and queued change delivery.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptiondoublePublic Scope.id member exposed by the AngularTS namespace contract.Public Scope.parent member exposed by the AngularTS namespace contract.Public Scope.root member exposed by the AngularTS namespace contract.Public Scope.scopeName member exposed by the AngularTS namespace contract. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tbatch(org.angular.ts.ng.Scope.BatchListener<T> fn) Runs synchronous scope mutations as one batch.Broadcasts an event downward through the scope hierarchy.final booleandeleteProperty(jsinterop.base.JsPropertyMap<Object> target, double property) Public Scope.deleteProperty member exposed by the AngularTS namespace contract.final booleandeleteProperty(jsinterop.base.JsPropertyMap<Object> target, Object property) Public Scope.deleteProperty member exposed by the AngularTS namespace contract.final booleandeleteProperty(jsinterop.base.JsPropertyMap<Object> target, String property) Public Scope.deleteProperty member exposed by the AngularTS namespace contract.booleandeleteProperty(jsinterop.base.JsPropertyMap<Object> target, Scope.DeletePropertyPropertyUnionType property) Public Scope.deleteProperty member exposed by the AngularTS namespace contract.voiddestroy()Destroys this scope and its descendants.Emits an event upward through the scope hierarchy.final ObjectIntercepts property access on the target object.final ObjectIntercepts property access on the target object.final ObjectIntercepts property access on the target object.get(jsinterop.base.JsPropertyMap<Object> target, Scope.GetPropertyUnionType property, Scope proxy) Intercepts property access on the target object.final ScopegetById(double id) Searches this scope tree for a scope with the given id.final ScopeSearches this scope tree for a scope with the given id.Searches this scope tree for a scope with the given id.voidMerges enumerable properties from the provided object into the current scope target.Creates a prototypically inherited child scope.newIsolate(Scope instance) Creates an isolate child scope that does not inherit watchable properties directly.org.angular.ts.ng.Scope.SubscriptionRegisters an event listener on this scope and returns a deregistration function.searchByName(String name) Searches the scope tree for a scope registered under the provided name.booleanIntercepts and handles property assignments on the target object.transcluded(Scope parentInstance) Creates a transcluded child scope linked to this scope and an optional parent instance.org.angular.ts.ng.Scope.Subscriptionwatch(String watchProp, org.angular.ts.ng.Scope.WatchListener listenerFn, boolean lazy, boolean directLeaf, boolean returnDeregister, boolean synchronousInitial, Object resolvedValue, boolean hasResolvedValue, Object listenerContext) Registers a watcher for a property along with a listener function.
-
Field Details
-
id
public double idPublic Scope.id member exposed by the AngularTS namespace contract. -
parent
Public Scope.parent member exposed by the AngularTS namespace contract. -
root
Public Scope.root member exposed by the AngularTS namespace contract. -
scopeName
Public Scope.scopeName member exposed by the AngularTS namespace contract.
-
-
Constructor Details
-
Scope
public Scope()
-
-
Method Details
-
batch
public <T> T batch(org.angular.ts.ng.Scope.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
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
public boolean deleteProperty(jsinterop.base.JsPropertyMap<Object> target, Scope.DeletePropertyPropertyUnionType property) Public Scope.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 public final boolean deleteProperty(jsinterop.base.JsPropertyMap<Object> target, Object property) Public Scope.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 public final boolean deleteProperty(jsinterop.base.JsPropertyMap<Object> target, String property) Public Scope.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 public final boolean deleteProperty(jsinterop.base.JsPropertyMap<Object> target, double property) Public Scope.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
public void destroy()Destroys this scope and its descendants. -
emit
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
public Object get(jsinterop.base.JsPropertyMap<Object> target, Scope.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 public final 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 public final 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 public final 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
Searches this scope tree for a scope with the given id.- Parameters:
id- Value supplied for the id parameter.- 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.
-
merge
Merges enumerable properties from the provided object into the current scope target.- Parameters:
newTarget- Value supplied for the newTarget parameter.
-
newIsolate
Creates an isolate child scope that does not inherit watchable properties directly.- Parameters:
instance- Value supplied for the instance parameter.- Returns:
- Method result.
-
new_
Creates a prototypically inherited child scope.- Parameters:
childInstance- Value supplied for the childInstance parameter.- Returns:
- Method result.
-
on
public org.angular.ts.ng.Scope.Subscription on(String name, org.angular.ts.ng.Scope.ScopeEventListener listener) 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.
-
searchByName
Searches the scope tree for a scope registered under the provided name.- Parameters:
name- Value supplied for the name parameter.- Returns:
- Method result.
-
set
public 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.
-
transcluded
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
public org.angular.ts.ng.Scope.Subscription watch(String watchProp, org.angular.ts.ng.Scope.WatchListener listenerFn, boolean lazy, boolean directLeaf, boolean returnDeregister, boolean synchronousInitial, Object resolvedValue, boolean hasResolvedValue, Object listenerContext) 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.returnDeregister- Value supplied for the returnDeregister parameter.synchronousInitial- Value supplied for the synchronousInitial parameter.resolvedValue- Value supplied for the resolvedValue parameter.hasResolvedValue- Value supplied for the hasResolvedValue parameter.listenerContext- Value supplied for the listenerContext parameter.- Returns:
- Method result.
-