<body ng-controller="FooController">
<input ng-model="foo" value="bar">
<button ng-click="changeFoo()">{{buttonText}}</button>
</body>
AngularJs uses a DOM-based templating mechanism. This means that the templates are the rendered HTML. When the application runs, the elements are first rendered with the original contents of the template.
Subsequently, AngularJs kicks in, and traverses the entire DOM tree, looking out for for special decorations, and then modifies the DOM according to these decorations. In fact, if you are quick (or cheat by setting some break points), you will notice a flicker between the two.
The special decorations that it looks out for are:
ng-
*{{like this}}
AngularJs allows for an extremely expressive syntax to be added to the
expressions within the templates,
including a limited subset of JavaScript expressions,
and filters using a UNIX-style pipe (|
) syntax.