# Class ControllerProvider

The ng.$controller $controller service is used by AngularTS to create new controllers.

This provider allows controller registration via the ng.$controllerProvider#register register method.

- Defined in src/core/controller/controller.js:28

##### Index

### Constructors

constructor

### Properties

$get

### Methods

addIdentifier
has
register

## Constructors

### constructor

- new ControllerProvider(): ControllerProvider

  #### Returns ControllerProvider

  - Defined in src/core/controller/controller.js:29

## Properties

### $get

$get: (string | (($injector: InjectorService) => Function))[] = ...

$get method for dependency injection.

#### Type declaration

- string
- ($injector: InjectorService) => Function
  - - ($injector: InjectorService): Function

    - #### Parameters

      - $injector: InjectorService

      #### Returns Function

      A service function that creates controllers.

- Defined in src/core/controller/controller.js:69

## Methods

### addIdentifier

- addIdentifier(
  locals: any,
  identifier: string,
  instance: any,
  name: string,
  ): void

  Adds an identifier to the controller instance in the given locals' scope.

  #### Parameters

  - locals: any

    The locals object containing the scope.

  - identifier: string

    The identifier to assign.

  - instance: any

    The controller instance.

  - name: string

    The name of the controller.

  #### Returns void

  - Defined in src/core/controller/controller.js:178

### has

- has(name: string): boolean

  Check if a controller with a given name exists.

  #### Parameters

  - name: string

    Controller name to check.

  #### Returns boolean

  True if the controller exists, false otherwise.

  - Defined in src/core/controller/controller.js:43

### register

- register(name: any, constructor: Function | any[]): void

  Register a controller.

  #### Parameters

  - name: any

    Controller name, or an object map of controllers where the keys are the names and the values are the constructors.

  - constructor: Function | any[]

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

  #### Returns void

  - Defined in src/core/controller/controller.js:55