Code
angularjs
angular.module('myApp', []);
angular.module('myApp').controller('MainController', function($scope) {
$scope.title = 'Hello AngularJS';
$scope.count = 0;
$scope.increment = function() {
$scope.count++;
};
$scope.reset = function() {
$scope.count = 0;
};
});
<!-- HTML usage -->
<body ng-app="myApp" ng-controller="MainController">
<h1>{{ title }}</h1>
<button ng-click="increment()">+1</button>
<button ng-click="reset()">Reset</button>
<p>Count: {{ count }}</p>
</body>