Storing the data in array using ng-model
<p>I want to store the data in an array using the ng-model. I have an controller as RegisterController in which i inject <code>$scope</code> with ng-model name as user i.e. <code>$scope.user={}</code>.Here i am reading the data from form input element and submitting the data that has <code>ng-model="user.name"</code> and now i want to store that name or the multiple values in that user object. </p>

<pre><code>&lt;form class="well" align="center"&gt;
  &lt;input ng-model="user.name" name="name"  type="text"&gt;&lt;br/&gt;
  &lt;input ng-model="user.name" name="mobile"  type="text"&gt;&lt;br/&gt;
  &lt;input ng-model="user.name" name="mail"  type="mail"&gt;&lt;br/&gt;
  &lt;input ng-model="user.name" type="password" name="otp"&gt;&lt;br/&gt;&lt;br/&gt;

  &lt;button type="button"&gt;Sign Up&lt;/button&gt;
  &lt;a href="#/login"&gt;Login&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;/form&gt;
</code></pre>

<p>and the controller is </p>

<pre><code>app.controller("RegisterController",function($scope){

  $scope.user={};
})
</code></pre>

<p>Now let me know to store the data in the user that as array with example</p>