Angular.js compile document to tree struction

the first step of angular.js is to compile document to element and childnode. this struction is similar with DOM.

module is key concept of angular.js. what is angular.js module.
A module is a collection of services, directives, controllers, filters, and configuration information.

for example:

1
var element = $compile('<p>{{total}}</p>')(scope);

it calls compile(…) function to find ‘ng-module’, ‘ng-controller’, something like ‘ng-xxxx’ and so on.

shortly, this steps compile html to tree, and Addmodule to lists, AddDirectives to directives lists.

this is critical steps of beginning. I will add more example and code to explain.

This entry was posted in Angular.js. Bookmark the permalink.