What is ng-include:ng-include used to show, compile , include HTML part..
Description of ng-include:ng-include has priority 0.
It is always created new scope, means code included by ng-include always add as a newly DOM.
It is used in three form : element, attribute, class..
Syntax of ng-include:
<element ng-include="expression">

<ng-include src="expression">

<element class="ng-include">

How to Use ng-include/ng-include Example::
Example 1:
<div ng-app="webapp">
    <div >
            Angularjs Example of ng-include
            <label><input type="radio" name="rdo" value="htmltemplate1" /> include htmltemplate1</label>
            <label><input type="radio" name="rdo" ng-value="htmltemplate2" />include htmltemplate1</label>
            <div ng-include="expression">

<div> Hello this is htmltemplate1</div>

<div> Hello this is htmltemplate2</div>

No comments :

Post a Comment