<html>
<script src="../../ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body ng-app="myApp" ng-controller="myCtrl">
<form ng-submit="myFunc()">
<input type="text">
<input type="submit">
</form>
<p>{{myTxt}}</p>
<p>This example demonstrates how to run an AngularJS function when a for is submitted.</p>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.myTxt = "You have not yet clicked submit";
$scope.myFunc = function () {
$scope.myTxt = "You clicked submit!";
}
});
</script>
</body>
<!-- Mirrored from www.w3schools.com/angular/tryit.asp?filename=try_ng_ng-submit by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:09:21 GMT -->
</html>