Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
<button ng-click="clickFunc()">Test click</button>
<div>
<!-- This text will be updated when the button is clicked -->
{{ testText }}
</div>
</div>
JavaScript
var myApp = angular.module('myApp', []);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.testText = '';
$scope.clickFunc = function () {
$scope.testText = 'User clicked';
};
}