From 7f1e2e48467f80cc083d24b44f088620e4e7bcb6 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 6 Jun 2011 08:50:35 -0700 Subject: new batch of docs --- ...dev_guide.compiler.understanding_compiler.ngdoc | 88 ++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc (limited to 'docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc') diff --git a/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc b/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc new file mode 100644 index 00000000..714ef9c0 --- /dev/null +++ b/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc @@ -0,0 +1,88 @@ +@workInProgress +@ngdoc overview +@name Developer Guide: Angular HTML Compiler: Understanding How the Compiler Works +@description + + +Every {@link api/angular.widget widget}, {@link api/angular.directive directive} and {@link +dev_guide.compiler.markup markup} is defined with a compile function, which the angular compiler +executes on each widget or directive it encounters. The compile function optionally returns a link +function. This compilation process happens automatically when the page is loaded when you specify +`ng:autobind` in the script tag from which you load the angular script file. (See {@link +dev_guide.bootstrap Initializing Angular}.) + + +The compile and link functions are related as follows: + + +* **compile function** — Registers a listener for the widget, directive, or markup expression. The +compiler calls this function exactly once. +* **link function** — Sets up the listener registered by the compile function. This function can be +called multiple times, once per cloned DOM element. For example, in the case of the {@link +api/angular.widget.@ng:repeat repeater widget} used in a list element (`