title: How do i get textbox value in angularjs?
body: <p>I am trying to create simple web page using angular.
  I have 2 textbox and also 2 buttons.
  1 button to set value prdefine in textbox
  2 write some text and add.
  When i will click on add button then textbox 1and 2 should printon screen another place.</p>
  
  <p>Here the code.
  index.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" ng-app="chatApp"&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;Chat Application&lt;/title&gt;
  &lt;script src="scripts/angular.min.js"&gt;&lt;/script&gt;
  &lt;script src="scripts/app.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="style.css"&gt;
  &lt;/head&gt;
  &lt;script&gt;
  function myFunction() {
  document.getElementById("Text1").value = "Johnny Bravo";
  }
  &lt;/script&gt;
  &lt;body ng-controller="chatController"&gt;
  &lt;div class="container"&gt;
      &lt;div class="chatArena"&gt;
  
          &lt;div class="userList"&gt;
              &lt;ul&gt;
                  &lt;li ng-repeat="person in listPeopleAdded" &gt;{{person.name}}&lt;/li&gt;
                  &lt;li ng-repeat="person in pretext" &gt;{{person.name}}&lt;/li&gt;
  
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="chatAdder"&gt;
          &lt;input type='text' ng-model='textbox' name='textbox1' id='Text1'&gt;
          &lt;button onclick="myFunction()" ng-click="pset(textbox)"&gt;set value&lt;/button&gt;
          &lt;br&gt;
          &lt;br&gt;
  
          &lt;input type="text" name="personName" class="chatInputPersonName" ng-model="personName"&gt;
          &lt;button ng-click="addPerson()"&gt;Add Value&lt;/button&gt;
      &lt;/div&gt;
      &lt;/div&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>var app = angular.module('chatApp',[]);
  
   app.controller('chatController',function($scope){
  
  $scope.pretext=[];
  $scope.listPeopleAdded = [];
  $scope.addPerson = function(){
      $scope.listPeopleAdded.push({name:$scope.personName})
  
  }
  $scope.pset = function(textbox){
      alert($scope.textbox)
      $scope.pretext.push({name:$scope.textbox})
  }
  
  });
  </code></pre>
  
  <p>in app.js alert($scope.textbox) show undefined value.</p>