Angular: Empty Fiddle

http://angularjs.org/

by Jugnu Pathak

HTML

<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<ul ng-controller="MyCtrl">
    <li ng-repeat="name in names" ng-click="$last && myFunction()">
        {{name}}
    </li>
</div>

JavaScript

var myApp = angular.module('myApp',[]);

//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});

function MyCtrl($scope) {
    $scope.names = ['Foo', 'Bar', 'Superhero'];
    $scope.myFunction = function(){
        alert('done');
    }
}