title: How to submit angular js form using ng-click
body: <p>I am trying to create a from using json file. So I have a json file I am calling it into my html using angular js I am getting problem when I click on save button which is using ng-click , Here I am trying to use the array of user like this:</p>
  
  <pre><code>       &lt;div ng-repeat="x in myWelcome.definition.attributes"&gt;
          &lt;div ng-repeat= "y in x.children "&gt;
            &lt;div ng-if ="y.rm_type_name == 'DV_TEXT'"&gt;
               &lt;input type="{{ y.node_id }}" name="{{ y.node_id }}" ng-model="user[y.node_id]"&gt;
            &lt;/div&gt;
            &lt;div ng-if ="y.rm_type_name == 'DV_CODED_TEXT'"&gt;
               &lt;input type="{{ y.node_id }}" name="{{ y.node_id }}" ng-model="user[y.node_id]"&gt;
            &lt;/div&gt;
  
          &lt;/div&gt;
          &lt;h1&gt;You entered: {{user}}&lt;/h1&gt;
  
        &lt;/div&gt;
        &lt;input type="submit" ng-click="update(user)" value="Save" /&gt;
  </code></pre>
  
  <p>And my controller is looking like this :</p>
  
  <pre><code>     $scope.update = function(user) {
         console.log(user);
       };
  </code></pre>
  
  <p>I am getting the undefined in my console here is the plunker :
  <a href="https://plnkr.co/edit/62g4YhkowQtwkyBOPKi5?p=preview" rel="nofollow">https://plnkr.co/edit/62g4YhkowQtwkyBOPKi5?p=preview</a></p>