how to call function in angularjs?

Today, We want to share with you how to call function in angularjs?.In this post we will show you Angularjs raise function in ng-click event with example, hear for calling function into another function with in the same Controller Angular Js we will give you demo and example for implement.In this post, we will learn about Angularjs Ng-Keypress Event Handling Directive with an example.

AngularJS Call Function in ng-click Event Example

Example 1: index.html

<!DOCTYPE html>
<html>
<head>
<title>
AngularJs calling Function in ng-click Event Example - www.pakainfo.com
</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script type="text/javascript">
var app = angular.module('ngclickApp', []);
app.controller('ngclickCtrl', function ($scope) {
$scope.totoalFlag = 0;
$scope.getdetails = function () {
$scope.totoalFlag = $scope.totoalFlag + 1;
}
});
</script>
</head>
<body>
<div ng-app="ngclickApp" ng-controller="ngclickCtrl">
<h2>AngularJs calling Function in ng-click Event Example - - www.pakainfo.com</h2>
<input type="button" style="cursor:pointer" value="Click Here" ng-click ="getdetails()" /><br /><br />
<span style="color:Red">Number of Times you Clicked: {{totoalFlag}}</span>
</div>
</body>
</html>

I hope you get an idea about AngularJS function scope Example with demo.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.