Program user interaction, users use mouse click, this is a common function.
In Angularjs, the Ammonium button click command is Ng-click.
Create Angularjs apps using the Angularjs language (a): Hello your name http://www.cnblogs.com/insus/p/8520555.html app in the previous article, ASP.
To create a controller for ANGULARJS:
pilotApp.controller(‘ClickDemoCtrl‘, [‘$http‘, ‘$location‘, ‘$rootScope‘, ‘$scope‘,
function ($http, $location, $rootScope, $scope) {
$scope.AngularjsButtonClick = function () {
$scope.ProcessMessage = "The Button clicked, alert message is: Hello~~";
}
}]
);
Source Code
To create an ASP. NET MVC Controller:
To add the ASP. NET MVC views View:
<div ng-app="PilotApp" ng-controller="ClickDemoCtrl">
<div>
<input type="button" value="Click" ng-click="AngularjsButtonClick()" />
</div>
<div>
<span ng-bind="ProcessMessage"></span>
</div>
</div>
Source Code
Run the Demo:
Using ANGULARJS language under ASP (b): Ng-click Event