This article mainly introduces some Angularjs basics. For more information, see which ones or who do not know where to start, so here I will follow a simple idea to start writing
1. angular. element
2. angular. Bootstrap
We know very well that the ng-app is applied to the node and angular will automatically initialize it for you. the initialization process is divided into the following steps:
1. angular will be automatically initialized during document load. First, the node specified by the ng-app command will be found.
2. load module-related commands
3. create an injector (dependency manager) related to the application)
4. use the developed ng-app as the root node to start compile the Dom.
Now let's initialize it ourselves to make something equivalent to the ng-app command. Angular. element: this is packaging. it encapsulates the original DOM element or HTML string as the jQuery element. Angular. Bootstrap can manually initialize the script. We use the two to initialize the script.
The code is as follows:
Bootstrap-manual
Here is outside ng-app ~~ {1 + 2 }}
Here is the ~~~~ in ng-app ~~~ {1 + 2 }}