Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IModule

Hierarchy

  • IModule

Index

Properties

name

name: string

requires

requires: string[]

Methods

component

  • Use this method to register a component.

    Parameters

    • name: string

      The name of the component.

    • options: IComponentOptions

      A definition object passed into the component.

    Returns IModule

config

  • config(configFn: Function): IModule
  • config(inlineAnnotatedFunction: any[]): IModule
  • config(object: Object): IModule
  • Use this method to register work which needs to be performed on module loading.

    Parameters

    • configFn: Function

      Execute this function on module load. Useful for service configuration.

    Returns IModule

  • Use this method to register work which needs to be performed on module loading.

    Parameters

    • inlineAnnotatedFunction: any[]

      Execute this function on module load. Useful for service configuration.

    Returns IModule

  • Parameters

    • object: Object

    Returns IModule

constant

  • constant<T>(name: string, value: T): IModule
  • constant(object: Object): IModule
  • Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.

    Type parameters

    • T

    Parameters

    • name: string

      The name of the constant.

    • value: T

      The constant value.

    Returns IModule

  • Parameters

    • object: Object

    Returns IModule

controller

  • controller(name: string, controllerConstructor: Function): IModule
  • controller(name: string, inlineAnnotatedConstructor: any[]): IModule
  • controller(object: Object): IModule
  • 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, or an object map of controllers where the keys are the names and the values are the constructors.

    • controllerConstructor: Function

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

    Returns IModule

  • 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, or an object map of controllers where the keys are the names and the values are the constructors.

    • inlineAnnotatedConstructor: any[]

    Returns IModule

  • Parameters

    • object: Object

    Returns IModule

decorator

  • decorator(name: string, decoratorConstructor: Function): IModule
  • decorator(name: string, inlineAnnotatedConstructor: any[]): IModule
  • Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.

    Parameters

    • name: string

      The name of the service to decorate

    • decoratorConstructor: Function

    Returns IModule

  • Parameters

    • name: string
    • inlineAnnotatedConstructor: any[]

    Returns IModule

directive

  • Register a new directive with the compiler.

    Parameters

    • name: string

      Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)

    • directiveFactory: IDirectiveFactory

      An injectable directive factory function.

    Returns IModule

  • Register a new directive with the compiler.

    Parameters

    • name: string

      Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)

    • inlineAnnotatedFunction: any[]

    Returns IModule

  • Parameters

    • object: Object

    Returns IModule

factory

  • factory(name: string, $getFn: Function): IModule
  • factory(name: string, inlineAnnotatedFunction: any[]): IModule
  • factory(object: Object): IModule
  • Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.

    Parameters

    • name: string

      The name of the instance.

    • $getFn: Function

      The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).

    Returns IModule

  • Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.

    Parameters

    • name: string

      The name of the instance.

    • inlineAnnotatedFunction: any[]

      The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).

    Returns IModule

  • Parameters

    • object: Object

    Returns IModule

filter

  • filter(name: string, filterFactoryFunction: Function): IModule
  • filter(name: string, inlineAnnotatedFunction: any[]): IModule
  • filter(object: Object): IModule
  • Parameters

    • name: string
    • filterFactoryFunction: Function

    Returns IModule

  • Parameters

    • name: string
    • inlineAnnotatedFunction: any[]

    Returns IModule

  • Parameters

    • object: Object

    Returns IModule

provider

  • Parameters

    Returns IModule

  • Parameters

    Returns IModule

  • Parameters

    • name: string
    • inlineAnnotatedConstructor: any[]

    Returns IModule

  • Parameters

    Returns IModule

  • Parameters

    • object: Object

    Returns IModule

run

  • run(initializationFunction: Function): IModule
  • run(inlineAnnotatedFunction: any[]): IModule
  • Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.

    Parameters

    • initializationFunction: Function

    Returns IModule

  • Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.

    Parameters

    • inlineAnnotatedFunction: any[]

    Returns IModule

service

  • service(name: string, serviceConstructor: Function): IModule
  • service(name: string, inlineAnnotatedConstructor: any[]): IModule
  • service(object: Object): IModule
  • Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function.

    Parameters

    • name: string

      The name of the instance.

    • serviceConstructor: Function

      An injectable class (constructor function) that will be instantiated.

    Returns IModule

  • Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function.

    Parameters

    • name: string

      The name of the instance.

    • inlineAnnotatedConstructor: any[]

      An injectable class (constructor function) that will be instantiated.

    Returns IModule

  • Parameters

    • object: Object

    Returns IModule

value

  • value<T>(name: string, value: T): IModule
  • value(object: Object): IModule
  • Register a value service with the $injector, such as a string, a number, an array, an object or a function. This is short for registering a service where its provider's $get property is a factory function that takes no arguments and returns the value service.

    Value services are similar to constant services, except that they cannot be injected into a module configuration function (see config) but they can be overridden by an Angular decorator.

    Type parameters

    • T

    Parameters

    • name: string

      The name of the instance.

    • value: T

      The value.

    Returns IModule

  • Parameters

    • object: Object

    Returns IModule

Generated using TypeDoc