AngularJs Templates

Templates are one of important feature that angularJs provides.

Here, templates are nothing but plain-old-html file with added instrctions on how model should be rendered on view.

This templates are parsed by browser into DOM. Then , this DOM becomes input for AngularJs compiler. AngularJS traverses the DOM template for rendering instructions, which are called directives.

The input to AngularJS is browser DOM and not an HTML string.Using the DOM as the input, rather than strings, is the biggest differentiation AngularJS has from its sibling frameworks.

Example shown below:

function UserController($scope) {
scope.images = [
{"name":"user1"},
{"name":"user2"},
{"name":"user3"}

];
}

<div ng-controller=”UserController”>
<ul>
<li ng-repeat=”user in users”>
<img ng-src=”{{user.name}}” >
</li>
</ul>
</div>


ProsperaSoft offers AngularJs development solutions. You can email at info@prosperasoft.com to get in touch with ProsperaSoft AngularJs experts and consultants.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>