title: can't add a new data to my simple JSON ($scope.customers)
body: <p>I'm just started to learn about angular.js so I'm really a newbie. I don't know if there is a syntax problem or any other simple problem but I just couldn't make that happen.</p>
  
  <p>I've started with <a href="https://www.youtube.com/watch?v=tnXO-i7944M" rel="nofollow">Dan Wahlin's tutorial</a>. And I will use Rodrigo Branas' book. </p>
  
  <pre><code>&lt;html ng-app="customersApp"&gt;
  &lt;head&gt;
      &lt;title&gt;App&lt;/title&gt;
      &lt;script src="angular.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          var app = angular.module('customersApp', []);
  
          app.controller('CustomersController', function($scope){
              $scope.customers = [
                  {"id": 1, "name": "Yusuf", "age": 18},
                  {"id": 2, "name": "Ahmetcan", "age": 17},
                  {"id": 3, "name": "Ender", "age": 20},
                  {"id": 4, "name": "Batuhan", "age": 16},
              ];
  
              $scope.add = function (name){
                  $scope.customers.push(angular.copy(name));
                  delete $scope.name;
              };
          });
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;input type="text" id="name" ng-model="nameTxt"/&gt; &lt;input ng-click="add(nameTxt)" type="submit"/&gt;
      &lt;table ng-controller="CustomersController"&gt;
          &lt;tr ng-repeat="cust in customers | filter:nameTxt"&gt;
              &lt;td&gt;{{cust.name}}&lt;/td&gt;
              &lt;td&gt;{{cust.age}}&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;br/&gt;
      You are looking for: {{nameTxt}}
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Everything works perfect except $scope.add function. The thing I'm try to is get nameTxt and add that to $scope.customers. </p>
  
  <p>I think that the problem is between JSON data structure and the data that I'm trying to add. But just don't know to how to solve that. Already, thanks..</p>
  
  <p>EDIT: <a href="http://ideone.com/td8BQf" rel="nofollow">Here is the example of Rodrigo..</a> </p>