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

    • Parameters

      • name: string
      • animationFactory: NamedInjectable

      Returns this

    • 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

    • Parameters

      Returns this

    • Parameters

      • configFn: ModuleConfigFn

      Returns this

    • Parameters

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

      Returns this

    • The $controller service is used by Angular to create new controllers. This provider allows controller registration via the register method.

      Parameters

      • name: string

        Controller name

      • ctlFn: Injectable<ControllerConstructor>

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

      Returns this

    • Parameters

      • name: string
      • decorFn: NamedInjectable

      Returns this

    • Parameters

      • name: string
      • directiveFactory: NamedInjectable

      Returns this

    • Parameters

      • name: string
      • providerFunction: NamedInjectable

      Returns this

    • Register a named reactive mode 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

      • TData extends object = Record<string, unknown>
      • TEvents extends object = MachineNoEvents

      Parameters

      • name: string

        Injectable name.

      • config: MachineConfig<TData, TEvents>

        Machine configuration.

      Returns this

    • Parameters

      • name: string
      • providerType: NamedInjectable

      Returns this

    • Register a REST resource as an injectable service.

      The resource factory is delegated to the $rest provider, 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: RestOptions = {}

        Optional RestService options.

      Returns this

    • Parameters

      • block: ModuleConfigFn

      Returns this

    • Parameters

      • name: string
      • serviceFunction: NamedServiceInjectable

      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: SseConfig = {}

        SSE connection options.

      Returns this

    • Register a router state during module configuration.

      This is equivalent to calling $stateProvider.state(...) in a config block, but keeps route declarations in the same fluent module API used for components, services, directives, and custom elements.

      Parameters

      Returns NgModule

    • Register a named router state during module configuration.

      The provided name is copied onto the state declaration before it is passed to $stateProvider.

      Parameters

      • name: string

        State name.

      • definition: Omit<StateDeclaration, "name">

        State declaration without a required name.

      Returns NgModule

    • Register a persistent object store as an injectable service.

      Store construction is delegated to $provide.store, which creates the service through the injector and persists it through the selected backend.

      Parameters

      • name: string

        Service name.

      • ctor: object | StoreCreator

        Constructor, factory, or object to persist.

      • type: StorageType

        Storage backend type.

      • OptionalbackendOrConfig: StorageLike & PersistentStoreConfig

        Custom backend or persistence options.

      Returns this

    • Parameters

      • name: string
      • object: unknown

        Allows undefined

      Returns this

    • Register a named WebAssembly module as an injectable service.

      The actual loading is delegated to the $wasm provider, so custom runtimes can decide whether WebAssembly support is included.

      Parameters

      • name: string

        Injectable name used to access the module exports.

      • src: string

        URL of the .wasm file to fetch and instantiate.

      • Optionalimports: WebAssembly.Imports = {}

        WebAssembly import object.

      • Optionalopts: WasmOptions = {}

        WebAssembly provider options.

        Supported keys:

        • raw: boolean
          • false (default): the injectable resolves to instance.exports.
          • true: the injectable resolves to { instance, exports, module }.

      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.

      • Optionalprotocols: string[] = []

        Optional subprotocols.

      • Optionalconfig: WebSocketConfig = {}

        WebSocket connection options.

      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: WebTransportConfig = {}

        WebTransport connection options.

      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.

      • scriptPath: string | URL

        Worker script URL.

      • Optionalconfig: WorkerConfig = {}

        Worker connection options.

      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

      • TData extends object = Record<string, unknown>
      • TEvents extends object = MachineNoEvents
      • TCommands extends object = WorkflowNoCommands

      Parameters

      • name: string

        Injectable name.

      • config: WorkflowConfig<TData, TEvents, TCommands>

        Workflow configuration.

      Returns this