AngularJS ng-submit
ညွှန်ကြားချက်
ဥပမာ
ဖောင်ကို ပေးပို့သည့်အခါ လုပ်ဆောင်ချက်တစ်ခု လုပ်ဆောင်ပါ-
<body ng-app="myApp" ng-controller="myCtrl">
<form ng-submit="myFunc()">
<input type="text">
<input type="submit">
</form>
<p>{{myTxt}}</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>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ဖောင်ကို တင်သွင်း သည့် ng-submit
အခါ လုပ်ဆောင်ရန် လုပ်ဆောင်ချက်ကို ညွှန်ကြားချက်တွင် သတ်မှတ်သည်။
ဖောင်တွင် ဖောင်မရှိပါက action
ng-submit
ဖောင်တင်ခြင်းမှ တားဆီးမည်ဖြစ်သည်။
အထားအသို
<form ng-submit="expression"></form>
<form> ဒြပ်စင်မှပံ့ပိုးထားသည်။
ကန့်သတ်တန်ဖိုးများ
Value | Description |
---|---|
expression | A function to be called when the form is being submitted, or an expression to be evaluated, which should return a function call. |