# Class Angular

Configuration option for AngularTS bootstrap process.

- Defined in src/loader.js:36

##### Index

### Constructors

constructor

### Properties

$injector
bootsrappedModules
Cache
errorHandlingConfig
EventBus
getController
getInjector
getScope
version

### Methods

bootstrap
init
injector
module

## Constructors

### constructor

- new Angular(): Angular

  #### Returns Angular

  - Defined in src/loader.js:37

## Properties

### $injector

$injector: InjectorService

- Defined in src/loader.js:148

### bootsrappedModules

bootsrappedModules: any[]

- Defined in src/loader.js:52
- Defined in src/loader.js:119

### Cache

Cache: Map<number, ExpandoStore>

- Defined in src/loader.js:41

### errorHandlingConfig

errorHandlingConfig: (config?: ErrorHandlingConfig) => ErrorHandlingConfig

#### Type declaration

- - (config?: ErrorHandlingConfig): ErrorHandlingConfig

  - Configure several aspects of error handling if used as a setter or return the current configuration if used as a getter.

    Omitted or undefined options will leave the corresponding configuration values unchanged.

    #### Parameters

    - `Optional` config: ErrorHandlingConfig

    #### Returns ErrorHandlingConfig

- Defined in src/loader.js:57

### EventBus

EventBus: PubSub

- Defined in src/loader.js:44

### getController

getController: (element: Element, name?: string) => Scope

#### Type declaration

- - (element: Element, name?: string): Scope

  - Gets the controller instance for a given element, if exists. Defaults to "ngControllerController"

    #### Parameters

    - element: Element

      The DOM element to get data from.

    - `Optional` name: string

      The DOM element to get data from.

    #### Returns Scope

    - The retrieved data

- Defined in src/loader.js:54

### getInjector

getInjector: (element: Element) => InjectorService

#### Type declaration

- - (element: Element): InjectorService

  - Return instance of InjectorService attached to element

    #### Parameters

    - element: Element

    #### Returns InjectorService

- Defined in src/loader.js:55

### getScope

getScope: (element: Element) => any

#### Type declaration

- - (element: Element): any

  - Gets scope for a given element.

    #### Parameters

    - element: Element

      The DOM element to get data from.

    #### Returns any

    - The retrieved data for the given key or all data if no key is provided.

- Defined in src/loader.js:56

### version

version: string

- Defined in src/loader.js:49

## Methods

### bootstrap

- bootstrap(
  element: string | Element | Document,
  modules?: any[],
  config?: AngularBootstrapConfig,
  ): InjectorService

  Use this function to manually start up AngularTS application.

  AngularTS will detect if it has been loaded into the browser more than once and only allow the first loaded script to be bootstrapped and will report a warning to the browser console for each of the subsequent scripts. This prevents strange results in applications, where otherwise multiple instances of AngularTS try to work on the DOM. *

  **Note:** Do not bootstrap the app on an element with a directive that uses ng.$compile#transclusion transclusion, such as ng.ngIf `ngIf`, ng.ngInclude `ngInclude` and ngRoute.ngView `ngView`. Doing this misplaces the app ng.$rootElement `$rootElement` and the app's auto.$injector injector, causing animations to stop working and making the injector inaccessible from outside the app.

      <!doctype html>
      <html>
      <body>
      <div ng-controller="WelcomeController">
        {{greeting}}
      </div>

      <script src="angular.js"></script>
      <script>
        let app = angular.module('demo', [])
        .controller('WelcomeController', function($scope) {
            $scope.greeting = 'Welcome!';
        });
        angular.bootstrap(document, ['demo']);
      </script>
      </body>
      </html>

  #### Parameters

  - element: string | Element | Document

    DOM element which is the root of AngularTS application.

  - `Optional` modules: any[]

    an array of modules to load into the application. Each item in the array should be the name of a predefined module or a (DI annotated) function that will be invoked by the injector as a `config` block. See: angular.module modules

  - `Optional` config: AngularBootstrapConfig

  #### Returns InjectorService

  The created injector instance for this application.

  - Defined in src/loader.js:106

### init

- init(element: Element | Document): void

  #### Parameters

  - element: Element | Document

  #### Returns void

  - Defined in src/loader.js:195

### injector

- injector(modules: any[], strictDi: boolean): InjectorService

  #### Parameters

  - modules: any[]
  - strictDi: boolean

  #### Returns InjectorService

  - Defined in src/loader.js:188

### module

- module(name: string, requires?: string[], configFn?: Function | any[]): NgModule

  The `angular.module` is a global place for creating, registering and retrieving AngularTS modules. All modules (AngularTS core or 3rd party) that should be available to an application must be registered using this mechanism.

  Passing one argument retrieves an existing import('./interface.ts').Module, whereas passing more than one argument creates a new import('./interface.ts').Module

  # Module

  A module is a collection of services, directives, controllers, filters, and configuration information. `angular.module` is used to configure the auto.$injector $injector.

      // Create a new module
      let myModule = angular.module('myModule', []);

      // register a new service
      myModule.value('appName', 'MyCoolApp');

      // configure existing services inside initialization blocks.
      myModule.config(['$locationProvider', function($locationProvider) {
        // Configure existing providers
        $locationProvider.hashPrefix('!');
      }]);

  Then you can create an injector and load your modules like this:

      let injector = angular.injector(['ng', 'myModule'])

  However it's more likely that you'll just use ng.directive:ngApp ngApp or angular.bootstrap to simplify this process for you.

  #### Parameters

  - name: string

    The name of the module to create or retrieve.

  - `Optional` requires: string[]

    If specified then new module is being created. If unspecified then the module is being retrieved for further configuration.

  - `Optional` configFn: Function | any[]

    Optional configuration function for the module that gets passed to NgModule.config().

  #### Returns NgModule

  A newly registered module.

  - Defined in src/loader.js:275