Hi friends in this post I am sharing about ngclick in angularjs. And also how to run in notepad.Kindly read tis post if you want run angularjs in notepad.
A controller is a JavaScript Object, created by a standard JavaScript object constructor.To control and also to initiate a function work in the angular js applications, controllers are used.
And to name this controller ng-controller directive is used.The controller now starts to work with an object $scope.$scope is used to mention the variables and to perform function process, where variables is a value that can be changed according to the needs of a program.Now this variable which is in the function is called by ng-click ngclick is an html event in Angular js. ngclick is used to make an click event.And it performs the task as per the given data's.
A controller is a JavaScript Object, created by a standard JavaScript object constructor.To control and also to initiate a function work in the angular js applications, controllers are used.
And to name this controller ng-controller directive is used.The controller now starts to work with an object $scope.$scope is used to mention the variables and to perform function process, where variables is a value that can be changed according to the needs of a program.Now this variable which is in the function is called by ng-click ngclick is an html event in Angular js. ngclick is used to make an click event.And it performs the task as per the given data's.
- If you learned how to run angular js local ,then proceed to the next steps.In the img.html file copy and paste below code and remove if any old codes written.
<html ng-app>
<head>
<title>Tecinfoweb:AngularJS ng-click concept </title>
<script src="angular/angular.min.js"></script>
</head>
<style>
</style>
<h1 >TECHINFOWEB</hh1>
<h3>AngularJS ng-click using notepad</h3>
<body>
<h3>Example:</h3>
<div ng-controller="techinfowebcontroller">
<button ng-click="techinfowebclick = techinfowebclick + 1">Click here!</button>
<p>{{ techinfowebclick }}</p>
</div>
<script>
function techinfowebcontroller($scope) {
$scope.techinfowebclick = 0;
}
</script>
</body>
</html>
0 comments :
Post a Comment