View source Improve this doc

# `ngView`
directive in module `ngRoute`

## Description

### Overview

`ngView` is a directive that complements the $route service by including the rendered template of the current route into the main layout (`index.html`) file. Every time the current route changes, the included view changes with it according to the configuration of the `$route` service.

Requires the `ngRoute` module to be installed.

## Usage

This directive can be used as custom element, but be aware of IE restrictions.

as element:

    <ng-view>
    </ng-view>

as attribute

    <ANY ng-view>
       ...
    </ANY>

as class

    <ANY class="ng-view">
       ...
    </ANY>

### Directive info

- This directive creates new scope.

### Animations

- enter - animation is used to bring new content into the browser.
- leave - animation is used to animate existing content away.
- The enter and leave animation occur concurrently.

Click here to learn more about the steps involved in the animation.

## Events

- ### $viewContentLoaded

  Emitted every time the ngView content is reloaded.

  #### Type:

  emit

  #### Target:

  the current ngView scope

## Example

#### Source

## Demo