Friday, 13 November 2015

ng-submit

What is ng-submit:ng-submit used to perform a particular task on form submission..
Description of ng-submit:ng-submit has priority 0..
Syntax of ng-submit:
<form ng-submit="myfun()">


</form>
How to Use ng-submit/ng-submit Example::

<div ng-app="webapp">
    <div ng-controller="angularjsexampleCtlr">
        <div>
            Angularjs Example of ng-submit
            <form ng-submit="myfun()">
                <label>

                </label>

            </form>
        </div>
    </div>
</div>

<script>
    angular.module('webapp', []).controller('angularjsexampleCtlr', function ($scope, $http) {
        $scope.myfun = function () {
            $scope.msg = "Hey this ng-submit result.";
            alert($scope.msg);
        }
    });

    </script>

No comments :

Post a comment