<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>my form to submit data in jsom..samira</title>
  <script 
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js";></script>
</head>

<body ng-app="myForm">
  <script>
    angular.module('myForm', [])
      .controller('myController', ['$scope', function($scope) {
          $scope.user = [{'name':'A','email':'[email protected]'}];
          $scope.name = 'hello';
           $scope.email = '[email protected]';
       
          $scope.submit = function() {
          if ($scope.name) {
              $scope.user.push(this.name);
              $scope.user.push(this.email);
              $scope.name = '';
               $scope.email = '';
            }
          };
        }
      ]);
  </script>
  <form ng-submit="submit()" ng-controller="myController">
      Name<input type="text" ng-model="name" name="text" /><br><br>
    Email<input type="email" ng-model="email" name="text" />
    <input type="submit" id="submit" value="Submit" />
    
    <pre>user ={{user|json}}</pre>
    
    
    </form>
</body>

</html>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to