AngularJS Example
HTML
<div ng-app="">
<div ng-controller="me">
I have {{friends.length}} friends. They are:
<ul>
<li ng-repeat="friend in friends | filter:call">
[{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.
</li>
</ul>
</div>
</div>
CSS
</style> <!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ -->
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<style>
.ng-invalid { border: 1px solid red; }
JavaScript
function me($scope){
$scope.friends = [{name:'John', age:25}, {name:'Mary', age:28}];
$scope.call = function(a){
if (a.age > 26)
return true;
else
return false;
}
}