From 2ce0485e6f21c77e84fd4fc07a9b15adc90a7fd8 Mon Sep 17 00:00:00 2001 From: Brad Green Date: Tue, 27 Mar 2012 08:27:42 -0700 Subject: Rewrite of Automatic Initialization doc Added examples, explained the reasons why you initialize the whole app or parts of the page. --- .../guide/dev_guide.bootstrap.auto_bootstrap.ngdoc | 35 ++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'docs/content/guide') diff --git a/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc b/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc index 5cae98a5..2567cf68 100644 --- a/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc +++ b/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc @@ -2,8 +2,7 @@ @name Developer Guide: Initializing Angular: Automatic Initialization @description -Angular initializes automatically when you load the angular script into your page that contains an element -with `ng-app` directive: +For Angular to manage the DOM for your application, it needs to compile some or all of an HTML page. Angular does this initialization automatically when you load the angular.js script into your page and insert an `ng-app` directive (attribute) into one of the page's elements. For example, we can tell Angular to initialize the entire document:
 
@@ -17,30 +16,36 @@ with `ng-app` directive:
 
 
-From a high-level view, this is what happens during angular's automatic initialization process: +You can also tell Angular to manage only a portion of a page. You would want to do this if you are using some other framework to manage other parts of the page. You do this by placing the `ng-app` directive on one or more container elements in the document. For example: -1. The browser loads the page, and then runs the angular script. Angular waits for the -`DOMContentLoaded` (or 'Load') event to attempt to bootstrap. +
+
+ I can add: {{ 1+2 }} +
+
-2. Angular looks for the `ng-app` directive. If found it then proceeds to compile the DOM element and its children. -Optionally the `ng-app` may specify a {@link api/angular.module module} to load before the compilation. For details on -how the compiler works, see {@link dev_guide.compiler Angular HTML Compiler}. +You can also ask `ng-app` to load additional {@link api/angular.module modules} containing services, directives or filers that you'll use on the page. + +
+
+... +
+