AngularJs ng-repeat
AngularJs ng-repeat directive : AngularJs ng-repeat directive is used to iterate for each element in collection.
Syntax : AngularJs ng-repeat
<div ng-app = ''> <div ng-app="" ng-init="myArr=['First Item','Second Item','Third Item', 'Fourth Item','Fifth Item']" > <p data-ng-repeat="a in myArr" style="background:yellow;border:1px solid red; margin:10px;">{{a}}</p> </div> </div>
Note you can give your ng-app name.
Let us understand with simple example
Example 1
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script> </head> <body> <div ng-app = ''> <div ng-app="" ng-init="myArr=['First Item','Second Item','Third Item', 'Fourth Item','Fifth Item']" > <p data-ng-repeat="a in myArr" style="background:yellow;border:1px solid red; margin:10px;">{{a}}</p> </div> </div> </body> </html> |
Advertisements
Add Comment
📖 Read More
- 1. AngularJs Controllers
- 2. AngularJs Filters
- 3. Angularjs Http Intro
- 4. Angularjs Http Get Method
- 5. Angularjs Http Post Method
- 6. AngularJs Tables
- 7. AngularJs DOM
- 8. AngularJs Events
- 9. AngularJs Modules
- 10. AngularJs Forms