AngularJS Live Example

HTML

<script src="http://code.angularjs.org/0.10.5/angular-0.10.5.min.js" ng:autobind></script>

<script>
    function Ctrl() {
    } 

    Ctrl.prototype.getList = function() {
      /*
       * there are two ways to define hash key - as a constant or as a function, both must
       * return values primitive values that are equivalent for objects that are 
       * equvivalent. if you use a function then it should ideally be O(1) or O(n) at 
       * most if you expect the object to be small. 
       */
      return [{name:'John', age:25, $$hashKey: 0}, {name:'Mary', age:28, $$hashKey: function() {return JSON.stringify(this)}}];
    };
</script>

<div ng:controller="Ctrl">
  I have {{getList().length}} friends. They are:
  <ul>
    <li ng:repeat="friend in getList()">
      [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.
    </li>
  </ul>
</div>