44
55# Overview
66
7- Angular's {@link api/angular.module. ng.$compile HTML compiler} allows the developer to teach the
7+ Angular's {@link api/ng.$compile HTML compiler} allows the developer to teach the
88browser new HTML syntax. The compiler allows you to attach behavior to any HTML element or attribute
99and even create new HTML element or attributes with custom behavior. Angular calls these behavior
10- extensions {@link api/angular.module. ng.$compileProvider.directive directives}.
10+ extensions {@link api/ng.$compileProvider.directive directives}.
1111
1212HTML has a lot of constructs for formatting the HTML for static documents in declarative fashion.
1313For example if something needs to be centered, there is no need to provide instructions to the
@@ -17,7 +17,7 @@ element to achieve the desired behavior. Such is the power of declarative langua
1717
1818But the declarative language is also limited, since it does not allow you to teach the browser new
1919syntax. For example there is no easy way to get the browser to align the text at 1/3 the position
20- instead of 1/2. What is needed is a way to teach browser new HTML syntax.
20+ instead of 1/2. What is needed is a way to teach browser new HTML syntax.
2121
2222Angular comes pre-bundled with common directives which are useful for building any app. We also
2323expect that you will create directives that are specific to your app. These extension become a
@@ -29,7 +29,7 @@ involved.
2929
3030# Compiler
3131
32- Compiler is an angular service which traverses the DOM looking for attributes. The compilation
32+ Compiler is an angular service which traverses the DOM looking for attributes. The compilation
3333process happens into two phases.
3434
3535 1. **Compile:** traverse the DOM and collect all of the directives. The result is a linking
@@ -39,7 +39,7 @@ process happens into two phases.
3939 scope model are reflected in the view, and any user interactions with the view are reflected
4040 in the scope model. Making the scope model a single source of truth.
4141
42- Some directives such {@link api/angular.module. ng.$compileProvider. directive. ngRepeat
42+ Some directives such {@link api/ng.directive: ngRepeat
4343`ng-repeat`} clone DOM elements once for each item in collection. Having a compile and link phase
4444improves performance since the cloned template only needs to be compiled once, and then linked
4545once for each clone instance.
@@ -50,7 +50,7 @@ once for each clone instance.
5050Directive is a behavior which should be triggered when specific HTML constructs are encountered in
5151compilation process. The directives can be placed in element names, attributes, class names, as
5252well as comments. Here are some equivalent examples of invoking {@link
53- api/angular.module. ng.$compileProvider. directive. ngBind `ng-bind`} directive.
53+ api/ng.directive: ngBind `ng-bind`} directive.
5454
5555<pre>
5656 <span ng-bind="exp"></span>
@@ -60,7 +60,7 @@ api/angular.module.ng.$compileProvider.directive.ngBind `ng-bind`} directive.
6060</pre>
6161
6262Directive is just a function which executes when the compiler encounters it in the DOM. See {@link
63- api/angular.module. ng.$compileProvider.directive directive API} for in depth documentation on how
63+ api/ng.$compileProvider.directive directive API} for in depth documentation on how
6464to write directives.
6565
6666Here is a directive which makes any element draggable. Notice the `draggable` attribute on the
@@ -115,9 +115,9 @@ principles.
115115
116116# Understanding View
117117
118- There are many templating systems out there. Most of them consume a static string template and
118+ There are many templating systems out there. Most of them consume a static string template and
119119combine it with data, resulting in a new string. The resulting text is then `innerHTML`ed into
120- an element.
120+ an element.
121121
122122<img src="img/One_Way_Data_Binding.png">
123123
0 commit comments