Tuesday, April 21, 2015

angularjs use of ng-repeat loop

<html>
<title> AngularJs Directives </title>

<body>

<div ng-app="" ng-controller="firstController">

<p>List of Countries with locale:</p>
<ol>
{{ data }}
<li ng-repeat="item in data">

{{ 'firstname: ' + item.firstname + ', lastname: ' + item.lastname }}

</li>
</ol>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>

<script>

function firstController($scope)
{

$scope.data=[
{
firstname:'shekhar',
lastname:'nawale'
},
{
firstname:'prashant',
lastname:'adpawar'
},
{
firstname:'abhishek',
lastname:'tripathi'
},
]



}

</script>

</body>
</html>

No comments:

Post a Comment