ng-repeat directive is useful for repeat the elements.
Syntax:
<li ng-repeat="value in cities">
Full Example:
<!DOCTYPE html>
<html>
<head>
<script src="angular.min.js"></script>
</head>
<body ng-app>
<div ng-init="cities=['Bangalore','Hyderabad','Goa']">
Cities in India
<ul>
<li ng-repeat="value in cities">
{{value}}
</li>
</ul>
</div>
</body>
</html>
Output:
Cities in India
If you have any queries or suggestions, please feel free to ask in comments section.
Syntax:
<li ng-repeat="value in cities">
Full Example:
<!DOCTYPE html>
<html>
<head>
<script src="angular.min.js"></script>
</head>
<body ng-app>
<div ng-init="cities=['Bangalore','Hyderabad','Goa']">
Cities in India
<ul>
<li ng-repeat="value in cities">
{{value}}
</li>
</ul>
</div>
</body>
</html>
Output:
Cities in India
- Bangalore
- Hyderabad
- Goa
If you have any queries or suggestions, please feel free to ask in comments section.
Post a Comment
Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.