# `ngApp` (directive in module `ng` )

Improve this doc

## Description

Use this directive to auto-bootstrap on application. Only one directive can be used per HTML document. The directive designates the root of the application and is typically placed at the root of the page.

In the example below if the `ngApp` directive would not be placed on the `html` element then the document would not be compiled and the `{{ 1+2 }}` would not be resolved to `3`.

`ngApp` is the easiest way to bootstrap an application.

#### Source

#### Demo

## Usage

as attribute

    <ANY ng-app="{angular.Module}">
       ...
    </ANY>

as class

    <ANY class="ng-app: {angular.Module};">
       ...
    </ANY>

### Parameters

- `ngApp – {angular.Module} –`

  an optional application `module` name to load.