Templates in AngularJS

Introduction

Templates are written with HTML which contains the specific attributes and elements in AngularJS. AngularJS combine the information from model (scope) and controller with template and render the view that can visible to user on browser. Template is great features of AngularJS for working with HTML that help us to split up development works.

There four type of Angular elements and attributes can be used in template:

  • Directive: Directives are something that introduces new syntax. They are markers on the DOM element which provides some special behavior to DOM elements and tell AngularJS's HTML compiler to attach.

  • Filter: AngularJS Filters cover many common uses such as formatting dates and currencies, limiting the number of items to be displayed, etc. The filters are very helpful to improve the workflow while building Angular apps.

  • Markup: The double curly brace notation ({{ }}) to bind expressions with elements is built-in Angular markup.

  • Form controls: It use to validate to user input.