Ng-include Directive :
An ng-include is use to inject a DOM in any html pages. This inject DOM component is active scope in mention or declared controllers.
A purpose of ng-include is reuse the DOM component in more than pages. Say for example header page section is common to the all pages means, This DOM element move to one file and than this file include all the pages.
<ng-include src="" onload="" autoscroll="">
or
<div ng-include="" onload="" autoscroll="">
src - give your dom component file path.
onload - any action you will make on load the dom
autoscroll - if need scroll you can apply here
Sample:
<div ng-include="'templates/include/header_tpl.html'"></div>
or
<div ng-include="'templates/include/header.tpl'"></div>
.tpl or .html you save the template file format. These format is supported ng-include.
<ion-view>
<div ng-include="'templates/include/header.tpl'"></div>
<ion-content >
<div >EVENTS</div>
.................
</div>
</ion-content>
</ion-view>
Comments
Post a Comment