title: How do I get an input value into Angular's $scope?
body: <p>I'm new to Angular, and I am trying to do something really basic. Here is a part of a view (all angular files are added elsewhere) :</p>
  
  <pre><code> &lt;div ng-controller='ctrl'&gt;
      &lt;input type='text' ng-model='id'&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>And here is my controller :</p>
  
  <pre><code> module.controller('ctrl',['$scope', function ($scope) {
  
      // get the scope value here
  }]);
  </code></pre>
  
  <p>What I'm trying to do is really simple. I'd like to use the input value. I tried something like <code>$scope.data = []</code> and <code>$scope.data.push($scope.id)</code> to create an array with the scope's value, but it didn't work. When I tried to display the value, I got an 'undefined' on the console. </p>
  
  <p>Do you guys have any idea ?</p>
  
  <p>Edit : The view also has a button with the <code>ng-click</code> directive which trigger the controller's function where I try to get my value.</p>