Original address: Http://docs.angularjs.org/guide/dev_guide.mvc.understanding_model
Angular template is a declaration specification that, together with the model and controller information, renders the view that the user sees in the browser. It is a static DOM, including HTML, CSS, angular special elements, and angular the specified element attributes. Angular elements and attributes indicate angular to extend the behavior and to convert the template DOM to a dynamic view of the DOM.
Here are the types of angular elements that we can use in the template already element attributes:
- Directive (http://www.cnblogs.com/lcllao/archive/2012/09/09/2677190.html)-a property or element, or control, that extends an existing DOM element or represents a reusable DOM component.
- Markup (http://code.angularjs.org/1.0.2/docs/api/ng. $interpolate)-a angular tag that is built into an element by means of a double curly brace notation {{}} to bind an expression.
- Filter (http://code.angularjs.org/1.0.2/docs/guide/dev_guide.templates.filters)-Used to format the data we see to the user.
- Form controls (http://www.cnblogs.com/lcllao/archive/2012/09/17/2688127.html)-let's verify user input.
Note: In addition to declaring the above elements in a template, we can also access these elements in JavaScript code.
The following code snippet shows a simple angular template, which is bound by the standard HTML tag and angular directive, curly braces ({{expression}},http:// www.cnblogs.com/lcllao/archive/2012/09/16/2687162.html) composition.
<! DOCTYPE html><!--Ng-app, define the scope of application, create root scop--> In a simple single-page application, the template consists of HTML, CSS, and angular directive, all contained in an HTML file (usually called it index.html). But in some more complex applications, we can use "partials" to display multiple views in a single page, and the template segments will be stored in separate HTML files. We can use the $route service (http://code.angularjs.org/1.0.2/docs/api/ng. $route) with Ngview directive in the main page (http:// Code.angularjs.org/1.0.2/docs/api/ng.directive:ngview) to collaborate with "include" those partials. An example of this technique is shown in the seventh to eighth step of angular tutorial (http://code.angularjs.org/1.0.2/docs/tutorial/index). (This Part I'll play-_-! later)
Angularjs Study notes--understanding Angular Templates