title: How to clear input field in AngularJs?
body: <p>When a user types anything in the input field and clicks the add button, the input is added into the array and gets displayed in the list.</p>
  
  <p>However I am not able to clear the input field after pushing it into the array. </p>
  
  <p>I am new to AngularJs, and would appreciate some help.
  Thanks in advance.</p>
  
  <p>Here is my Code:</p>
  
  <pre><code>&lt;div class="container"&gt;
  &lt;div ng-controller="mainController"&gt;
  &lt;input type="text" ng-model='name' placeholder="name"&gt;
  &lt;input type="text" ng-model='number' placeholder="number"&gt;
  &lt;button ng-click="addToList()"&gt;Add&lt;/button&gt;
  &lt;ul ng-repeat="person in array_of_Names"&gt;
       &lt;li&gt;{{$index + 1}}.Name:{{person.name}},Phone:{{person.number}}&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And my app.js:</p>
  
  <pre><code> var myApp = angular.module('myApp', []);
   myApp.controller('mainController',['$scope',function($scope){
   $scope.array_of_Names = [];
   $scope.addToList = function(){
      var person = {
          name: $scope.name,
          number: $scope.number
      };
      $scope.array_of_Names.push(person);
   };
  
  }]);
  </code></pre>