# Class $ControllerProvider

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

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

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

#####
Index

### Constructors

constructor

### Properties

$get

### Methods

addIdentifier
has
register

##
Constructors

### constructor

- new $ControllerProvider(): $ControllerProvider

- #### Returns $ControllerProvider

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

##
Properties

### $get

$get: (string | (($injector: any) => ((expression: any, locals: any, later: any, ident: any) => any)))[] = ...

$get method for dependency injection.

#### Param: $injector

#### Returns

A service function that creates controllers.

- Defined in core/controller/controller.js:72

##
Methods

### addIdentifier

- addIdentifier(locals, identifier, instance, name): 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 core/controller/controller.js:174

### has

- has(name): 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 core/controller/controller.js:43

### register

- register(name, constructor): 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 core/controller/controller.js:55