Skip to content

Commit c4eb605

Browse files
committed
Add more information about template view
1 parent 41dfe81 commit c4eb605

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,22 @@ For example if we evaluate the template above in the context of the following ob
717717
AngularJS templates are actually HTML, they are not in an intermediate format like the traditional templates are.
718718
What AngularJS compiler does is to traverse the DOM tree and look for already known directives (elements, attributes, classes or even comments). When AngularJS finds any of these directives it invokes the logic associated with them, which may involve evaluation of different expressions in the context of the current scope.
719719

720+
For example:
721+
722+
```html
723+
<ul ng-repeat="name in names">
724+
<li>{{name}}</li>
725+
</ul>
726+
```
727+
728+
in the context of the scope:
729+
730+
```javascript
731+
$scope.names = ['foo', 'bar', 'baz'];
732+
```
733+
734+
will produce the same result as the one above. The main difference here is that the template is not wrapped inside a `script` tag but is HTML instead.
735+
720736
## AngularJS application Patterns
721737

722738
### Data Mapper

0 commit comments

Comments
 (0)