The angular JS framework is briefly described in the previous section, where the angular bootstrap (bootstrap) and compiler (compilation) mechanisms will continue.
One: Initialization of Bootstrap:angular
The initial automation recommended by 1:angular is as follows:
<!doctype html>
Use Ngapp to mark the root node of the application that you need to automatically boot, typically HTML tag. The domcontentloaded event triggers the angular to automatically look for Ngapp as the root node of the application and, if found, does the following:
Load module (module) related directive (instruction).
Create an application injector (angular injection mechanism).
Compiles the instructions that handle Ng-app as the root node. This allows you to customize the Select Dom node as the application root node.
<! DOCTYPE html>
2: Manual initialization:
If you want to have more control over the initialization, you can initialize the automatic initialization instead of the angular by using a custom manual boot method. For example, you need to do something before angular the template, such as changing some of the template's content. The manual boot method will be as follows:
<!doctype html>
After all the code on the page has finished loading, locate the HTML template root node (typically the document element).
Call Api/angular.bootstrap (Angular.bootstrap (element[, modules)) to compile the template so that it can be executed.