Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
<p ng-repeat="item in items">
<span ng-bind="getName(item)"></span>
</p>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.items = [
{ id: 0, name: 'Bar'},
{ id: 1, name: 'Foo'},
{ id: 2, name: 'Bie'},
{ id: 3, name: 'Xaa'}
];
$scope.getName = function (item) {
console.log('get name for ' + item.id);
return item.name;
}
}