AngularJS ng-submit command
AngularJS examples
After the form is submitted function:
<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 do not click submit! ';
$ Scope.myFunc = function () {
$ Scope.myTxt = "you click submit!";
}
});
</ Script>
</ Body>
<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 do not click submit! ';
$ Scope.myFunc = function () {
$ Scope.myTxt = "you click submit!";
}
});
</ Script>
</ Body>
try it"
Definition and Usage
ng-submit the form submission instructions for performing the specified functions.
grammar
<Form ng-submit = "expression "> </ form>
<Form> element supports the property.
Parameter Value
value | description |
---|---|
expression | After the form is submitted function will be called, will be executed or an expression, the expression returns a function call. |