AngularTS
    Preparing search index...

    Class NgModule

    Modules are collections of application configuration information for components: controllers, directives, filters, etc. They provide recipes for the injector to do the actual instantiation. A module itself has no behaviour but only state. A such, it acts as a data structure between the Angular instance and the injector service.

    Index

    Constructors

    • Parameters

      • name: string

        Name of the module

      • requires: string[]

        List of modules which the injector will load before the current module

      • OptionalconfigFn: ModuleConfigFn

      Returns NgModule

    Properties

    name: string

    Methods

    • 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.

      Type Parameters

      • T extends object = Record<string, unknown>

      Parameters

      Returns this

    • Declare built-in AngularTS service configuration during the config phase.

      Parameters

      Returns this

    • Parameters

      • name: string
      • object: string | number | object

      Returns this

    • The $controller service is used by Angular to create new controllers. Named controllers are stored in the owning runtime's controller registry.

      Parameters

      • name: string

        Controller name

      • ctlFn: Injectable<ControllerConstructor>

        Controller constructor fn (optionally decorated with DI annotations in the array notation)

      Returns this

    • Register a lazy router state namespace during module configuration.

      Lazy route declarations use the same composed router runtime as static module routes.

      Parameters

      • prefix: string

        State name prefix to load on demand.

      • loader: LazyStateLoader

        Loader invoked by the router when a transition targets the prefix.

      Returns this

    • 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.

      Type Parameters

      Parameters

      • name: string

        Injectable name.

      • config:
            | InferredNamedMachineConfig<TData, TStates>
            | Injectable<() => InferredNamedMachineConfig<TData, TStates>>

        Machine configuration or a resolvable config factory.

      Returns this

    • 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.

      Type Parameters

      Parameters

      Returns this

    • 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:

      app.model("user", () => ({ name: "John", authenticated: false }));
      

      Type Parameters

      • T extends Record<string, unknown>

      Parameters

      • name: string

        Injectable model name.

      • initial: ModelInitializer<T>

        Plain object state or an injectable factory that returns plain object state.

      Returns this

    • 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.

      Type Parameters

      • T = unknown

      Parameters

      • name: string

        Service name.

      • url: string

        Base URL or URI template.

      • OptionalentityClass: EntityClass<T>

        Optional constructor for mapping JSON.

      • Optionaloptions: DynamicConfig<RestOptions> = {}

        Optional RestService options, optionally produced by DI.

      Returns this

    • Configure the singleton $serviceWorker for this application.

      Parameters

      Returns this

    • Register a pre-configured SSE connection as an injectable service.

      The connection is created by $sse when the named service is requested.

      Parameters

      • name: string

        Injectable name.

      • url: string

        SSE endpoint.

      • Optionalconfig: DynamicConfig<SseConfig> = {}

        SSE connection options, optionally produced by DI.

      Returns this

    • 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

      Returns this

    • Parameters

      • name: string
      • object: unknown

        Allows undefined

      Returns this

    • 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: string

        Injectable name used to access the resource.

      • config: DynamicConfig<WasmLoadOptions>

        Module source and imports, optionally produced by DI.

      Returns this

    • 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.

      Type Parameters

      • T extends object = Record<string, unknown>

      Parameters

      Returns this

    • Register a pre-configured WebSocket connection as an injectable service.

      The connection is created by $websocket when the named service is requested.

      Parameters

      • name: string

        Injectable name.

      • url: string

        WebSocket endpoint.

      • Optionalconfig: DynamicConfig<WebSocketConfig> = {}

        WebSocket connection options, optionally produced by DI.

      Returns this

    • Register a pre-configured WebTransport connection as an injectable service.

      The connection is created by $webTransport when the named service is requested.

      Parameters

      • name: string

        Injectable name.

      • url: string

        WebTransport endpoint.

      • Optionalconfig: DynamicConfig<WebTransportConfig> = {}

        WebTransport connection options, optionally produced by DI.

      Returns this

    • 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: string

        Injectable name.

      • OptionalscriptPath: DynamicConfig<string | URL>

        Worker script URL, optionally produced by DI.

      • Optionalconfig: DynamicConfig<WorkerConfig> = {}

        Worker connection options, optionally produced by DI.

      Returns this

    • 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.

      Type Parameters

      • const TDefinition extends NamedWorkflowDefinition

      Parameters

      Returns this

    • 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.

      Type Parameters

      Parameters

      • name: string

        Injectable name.

      • config:
            | NamedWorkflowConfig<TContract>
            | Injectable<() => NamedWorkflowConfig<TContract>>

        Workflow configuration or a resolvable config factory.

      Returns this

    • 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.

      Type Parameters

      • TWorkflows extends Record<string, unknown> = Record<string, unknown>

      Parameters

      • name: string

        Injectable name.

      • config:
            | Omit<
                { id: string; workflows: TWorkflows } & {
                    autoPersist?: false;
                    autoRecover?: false;
                    persistence?: undefined;
                },
                "id",
            > & { id?: string }
            | Omit<
                { id: string; workflows: TWorkflows } & {
                    autoPersist?: boolean;
                    autoRecover?: boolean;
                    persistence:
                        | WorkflowSupervisorPersistenceConfig
                        | "indexeddb"
                        | WorkflowSupervisorPersistence<
                            WorkflowSupervisorSnapshot<
                                WorkflowSupervisorSnapshotMap<TWorkflows>,
                            >,
                        >;
                },
                "id",
            > & { id?: string }
            | Injectable<
                () => | Omit<
                    { id: string; workflows: TWorkflows } & {
                        autoPersist?: false;
                        autoRecover?: false;
                        persistence?: undefined;
                    },
                    "id",
                > & { id?: string }
                | Omit<
                    { id: string; workflows: TWorkflows } & {
                        autoPersist?: boolean;
                        autoRecover?: boolean;
                        persistence:
                            | WorkflowSupervisorPersistenceConfig
                            | "indexeddb"
                            | WorkflowSupervisorPersistence<WorkflowSupervisorSnapshot<(...)>>;
                    },
                    "id",
                > & { id?: string },
            >

        Supervisor configuration or a resolvable config factory.

      Returns this