View (Directive) - Angular.js 1.8 - W3cubDocs
- directive in module ngRoute
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.
Directive Info
- This directive creates new scope.
- This directive executes at priority level 400.
Usage
- as element: <ng-view [onload="string"] [autoscroll="string"]> ... </ng-view>
- as attribute: <ANY ng-view [onload="string"] [autoscroll="string"]> ... </ANY>
- as CSS class: <ANY class="ng-view [onload: string;] [autoscroll: string;]"> ... </ANY>
Arguments
| Param | Type | Details |
|---|---|---|
| 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. - If the attribute is not set, disable scrolling. - If the attribute is set without value, enable scrolling. - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated as an expression yields a truthy value. |
Events
-
$viewContentLoaded
Emitted every time the ngView content is reloaded.
Type:
emitTarget:
the current ngView scope
Animations
| Animation | Occurs |
|---|---|
| enter | when the new element is inserted to the DOM |
| leave | when the old element is removed from to the DOM |
The enter and leave animation occur concurrently.
Click here to learn more about the steps involved in the animation.Example
© 2010–2020 Google, Inc.Licensed under the Creative Commons Attribution License 3.0. https://code.angularjs.org/1.8.2/docs/api/ngRoute/directive/ngView
Từ khóa » Ng-view
-
NgView - AngularJS: API
-
AngularJS Ng-view With Example: How To Implement View - Guru99
-
AngularJS Ng-view - Learn How To Implement View In ... - DataFlair
-
Angular Routing - W3Schools
-
AngularJS - Views - Tutorialspoint
-
AngularJS Tutorial: A Quick Example Using Ng-view, NgRoute ...
-
Ng-view
-
AngularJS: Ng-view Directive Not Working - Stack Overflow
-
AngularJS Tutorial => Ng-view
-
AngularJS
와 $routeProvider 사용 예 - Gists · GitHub -
AngularJS Ng-view Directive With Example - Tutlane
-
Ng-View Is Not Displaying Data In AngularJS Routing - Forum
-
AngularJS Templating Tutorial Using Ng-view