ngView – directive in module ngRoute

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 $routeservice.

Requires the ngRoute module to be installed.

Animations

Animation Occurs
enter when the new element is inserted to the DOM
leave when the old element is removed from to the DOM

Usage

  • as element: (This directive can be used as custom element, but be aware of IE restrictions).
    <ng-view
      [onload="string"]
      [autoscroll="string"]>
    ...
    </ng-view>
  • as attribute:
    <ANY
      [onload="string"]
      [autoscroll="string"]>
    ...
    </ANY>
  • as CSS class:
    <ANY class="[onload: string;] [autoscroll: string;]"> ... </ANY>
onload

(optional)
string Expression to evaluate whenever the view updates.
autoscroll

(optional)
string Whether ngView should call $anchorScroll to scroll the viewport after the view is updated.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s