Package org.angular.ts.ng
Class NgModule
java.lang.Object
org.angular.ts.ng.NgModule
@JsType(isNative=true,
name="ng.NgModule",
namespace="<global>")
public class NgModule
extends Object
AngularTS module registration surface for controllers, directives, services, factories, providers, filters, run blocks, and config blocks.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPublic NgModule.animation member exposed by the AngularTS namespace contract.<T> NgModuleappComponent(String name, AppComponentOptions<T> options) Register an options-backed application host custom element.Public NgModule.component member exposed by the AngularTS namespace contract.Declare built-in AngularTS service configuration during the config phase.Public NgModule.constant member exposed by the AngularTS namespace contract.controller(String name, Object ctlFn) The $controller service is used by Angular to create new controllers.Public NgModule.decorator member exposed by the AngularTS namespace contract.directive(String name, DirectiveFactoryFn directiveFactory) Public NgModule.directive member exposed by the AngularTS namespace contract.Public NgModule.factory member exposed by the AngularTS namespace contract.Public NgModule.filter member exposed by the AngularTS namespace contract.Register a lazy router state namespace during module configuration.Register a named reactive state machine as an injectable service.Register a named reactive model as an injectable app-owned service.Public NgModule.provider member exposed by the AngularTS namespace contract.Register a REST resource as an injectable service.<TDeclaration>
RouterModule<RoutesOf<TDeclaration, Object>> router(TDeclaration declaration) Register a module-owned router state tree during module configuration.Public NgModule.run member exposed by the AngularTS namespace contract.Public NgModule.service member exposed by the AngularTS namespace contract.serviceWorker(Object scriptUrl, ServiceWorkerConfig config) Configure the singleton `$serviceWorker` for this application.Register a pre-configured SSE connection as an injectable service.Register a persistent object store as an injectable service.Public NgModule.value member exposed by the AngularTS namespace contract.Register a named WebAssembly module as an injectable resource.<T> NgModulewebComponent(String name, ScopeElementConstructor<T> elementClass) Register a user-authored native custom element backed by an AngularTS scope.Register a pre-configured WebSocket connection as an injectable service.webTransport(String name, String url, Object config) Register a pre-configured WebTransport connection as an injectable service.Register a named Web Worker connection as an injectable service.Register a named workflow as an injectable service.workflowSupervisor(String name, Object config) Register a named workflow supervisor as an injectable service.
-
Field Details
-
name
Public NgModule.name member exposed by the AngularTS namespace contract.
-
-
Constructor Details
-
NgModule
public NgModule()
-
-
Method Details
-
animation
Public NgModule.animation member exposed by the AngularTS namespace contract.- Parameters:
name- Value supplied for the name parameter.animationFactory- Value supplied for the animationFactory parameter.- Returns:
- Method result.
-
appComponent
Register an options-backed application host custom element. The definition is installed when the module runs. The host element is a native custom element backed by an AngularTS child scope.- Parameters:
name- Custom element tag name.options- App component options.- Returns:
- Method result.
-
component
Public NgModule.component member exposed by the AngularTS namespace contract.- Parameters:
name- Value supplied for the name parameter.options- Value supplied for the options parameter.- Returns:
- Method result.
-
config
Declare built-in AngularTS service configuration during the config phase.- Parameters:
config- Built-in config map.- Returns:
- Method result.
-
constant
Public NgModule.constant member exposed by the AngularTS namespace contract.- Parameters:
name- Value supplied for the name parameter.object- Value supplied for the object parameter.- Returns:
- Method result.
-
controller
The $controller service is used by Angular to create new controllers. Named controllers are stored in the owning runtime's controller registry.- Parameters:
name- Controller namectlFn- Controller constructor fn (optionally decorated with DI annotations in the array notation)- Returns:
- Method result.
-
decorator
Public NgModule.decorator member exposed by the AngularTS namespace contract.- Parameters:
name- Value supplied for the name parameter.decorFn- Value supplied for the decorFn parameter.- Returns:
- Method result.
-
directive
Public NgModule.directive member exposed by the AngularTS namespace contract.- Parameters:
name- Value supplied for the name parameter.directiveFactory- Value supplied for the directiveFactory parameter.- Returns:
- Method result.
-
factory
Public NgModule.factory member exposed by the AngularTS namespace contract.- Parameters:
name- Value supplied for the name parameter.providerFunction- Value supplied for the providerFunction parameter.- Returns:
- Method result.
-
filter
Public NgModule.filter member exposed by the AngularTS namespace contract.- Parameters:
name- Value supplied for the name parameter.filterFn- Value supplied for the filterFn parameter.- Returns:
- Method result.
-
lazyState
Register a lazy router state namespace during module configuration. Lazy route declarations use the same composed router runtime as static module routes.- Parameters:
prefix- State name prefix to load on demand.loader- Loader invoked by the router when a transition targets the prefix.- Returns:
- Method result.
-
machine
Register a named reactive state machine as an injectable service. The machine is created by `$machine` when the named service is requested. The returned instance is not tied to any one scope lifetime; it registers with AngularTS scope proxies when assigned to a controller or scope.- Parameters:
name- Injectable name.config- Machine configuration or a resolvable config factory.- Returns:
- Method result.
-
model
Register a named reactive model as an injectable app-owned service. The model is created lazily by the owning `AppContext` when the service is first injected. Models are shared across every root scope managed by the same `AppContext`; they are not children of `$rootScope`. Assign an injected model to a controller or scope property to bind it in a template. DOM interpolation, `ng-bind`, directive expressions, nested object reads, and array length reads update when the app model changes. Mutating the model proxy schedules every affected observer. The injected `Model<T>` value is proxy-backed. It exposes scope-proxy methods such as `watch`, `batch`, `merge`, `on`, `emit`, `broadcast`, and `destroy`, plus `snapshot`, `restore`, and `sync` for model lifecycle and synchronization. Prefer the factory form for nontrivial initial state: ```ts app.model("user", () => ({ name: "John", authenticated: false })); ```- Parameters:
name- Injectable model name.initial- Plain object state or an injectable factory that returns plain object state.- Returns:
- Method result.
-
provider
Public NgModule.provider member exposed by the AngularTS namespace contract.- Parameters:
name- Value supplied for the name parameter.providerType- Value supplied for the providerType parameter.- Returns:
- Method result.
-
rest
Register a REST resource as an injectable service. The resource factory is delegated to the injected `$rest` service, keeping REST support configurable by custom runtimes.- Parameters:
name- Service name.url- Base URL or URI template.entityClass- Optional constructor for mapping JSON.options- Optional RestService options, optionally produced by DI.- Returns:
- Method result.
-
router
Register a module-owned router state tree during module configuration. Child state names are relative to their parent unless they contain a dot. Each route is queued for the composed router runtime, so module router trees compose with `lazyState(...)` and inherited route policies.- Parameters:
declaration- Router tree root declaration.- Returns:
- Method result.
-
run
Public NgModule.run member exposed by the AngularTS namespace contract.- Parameters:
block- Value supplied for the block parameter.- Returns:
- Method result.
-
service
Public NgModule.service member exposed by the AngularTS namespace contract.- Parameters:
name- Value supplied for the name parameter.serviceFunction- Value supplied for the serviceFunction parameter.- Returns:
- Method result.
-
serviceWorker
Configure the singleton `$serviceWorker` for this application.- Parameters:
scriptUrl- Value supplied for the scriptUrl parameter.config- Value supplied for the config parameter.- Returns:
- Method result.
-
sse
Register a pre-configured SSE connection as an injectable service. The connection is created by `$sse` when the named service is requested.- Parameters:
name- Injectable name.url- SSE endpoint.config- SSE connection options, optionally produced by DI.- Returns:
- Method result.
-
store
Register a persistent object store as an injectable service. Store construction is delegated to the internal provider registry, which creates the service through the injector and persists it through the selected backend.- Parameters:
name- Service name.ctor- Constructor, factory, or object to persist.type- Storage backend type.backendOrConfig- Custom backend or persistence options.- Returns:
- Method result.
-
value
Public NgModule.value member exposed by the AngularTS namespace contract.- Parameters:
name- Value supplied for the name parameter.object- Allows undefined- Returns:
- Method result.
-
wasm
Register a named WebAssembly module as an injectable resource. The actual loading is delegated to the `$wasm` service, so custom runtimes can decide whether WebAssembly support is included.- Parameters:
name- Injectable name used to access the resource.config- Module source and imports, optionally produced by DI.- Returns:
- Method result.
-
webComponent
Register a user-authored native custom element backed by an AngularTS scope. The element class must extend `ScopeElement`. Its static template, shadow, scope, inputs, and isolate properties configure the AngularTS wiring.- Parameters:
name- Custom element tag name.elementClass- Custom element class.- Returns:
- Method result.
-
webTransport
Register a pre-configured WebTransport connection as an injectable service. The connection is created by `$webTransport` when the named service is requested.- Parameters:
name- Injectable name.url- WebTransport endpoint.config- WebTransport connection options, optionally produced by DI.- Returns:
- Method result.
-
websocket
Register a pre-configured WebSocket connection as an injectable service. The connection is created by `$websocket` when the named service is requested.- Parameters:
name- Injectable name.url- WebSocket endpoint.config- WebSocket connection options, optionally produced by DI.- Returns:
- Method result.
-
worker
Register a named Web Worker connection as an injectable service. The actual connection is delegated to the `$worker` provider, so worker support remains provider-driven instead of directive-driven.- Parameters:
name- Injectable name.scriptPath- Worker script URL, optionally produced by DI.config- Worker connection options, optionally produced by DI.- Returns:
- Method result.
-
workflow
Register a named workflow as an injectable service. The workflow is created by `$workflow` when the named service is requested. Workflow behavior remains local to its `WorkflowConfig`; the provider does not apply global workflow defaults.- Parameters:
name- Injectable name.config- Workflow configuration or a resolvable config factory.- Returns:
- Method result.
-
workflowSupervisor
Register a named workflow supervisor as an injectable service. The supervisor is created when the named service is requested. It composes existing workflow configs or workflow instances and keeps persistence and recovery policy local to the supervisor config.- Parameters:
name- Injectable name.config- Supervisor configuration or a resolvable config factory.- Returns:
- Method result.
-