title: Angular. Push array in array
body: <p>I try to do TODO list using Angular.js
  I have function addTask, but it dosen't work. I try to give it project and than get array of tasks. In Chrome I see this mistake "Cannot read property 'tasks' of undefined"
  This is my app.js</p>
  
  <pre><code>    var app = angular.module('toDoList', ['ngDialog']);
          app.controller('MainCtrl', [
            '$scope',
            '$rootScope',
            'ngDialog',
            function($scope, $rootScope, ngDialog){
        $scope.test = 'Hello world!';
  
      $scope.projects = [
        {id: '1', title: 'For Home', tasks: [ {title: 'task 1', done:false }, {title: 'task 2', done: false }]},
        {id: '2', title: 'For Work', tasks: [ {title: 'task 1', done:false }, {title: 'task 2', done: false }]}
      ];
  
      $scope.addProject = function(){
        if(!$scope.title || $scope.title === '') { return; }
        $scope.projects.push({
          title: $scope.title
        });
      };
  
      $scope.addTask = function(project){
  
        $scope.project.tasks.push({
          title: $scope.tasktitle, done: false
        });
  }]);
  </code></pre>
  
  <p>This is my html code</p>
  
  <pre><code>    &lt;body ng-app="toDoList" ng-controller="MainCtrl"&gt;
    &lt;div class="project" ng-repeat="project in projects"&gt;
      &lt;span class="title"&gt;{{project.title}}&lt;/span&gt;
        &lt;form name="frm" ng-submit="addTask(project)"&gt;
          &lt;input 
            type="text" 
            class="form-control" 
            placeholder="Start to type task"
            ng-model="tasktitle"&gt;
          &lt;span class="input-group-btn"&gt;
            &lt;button class="btn btn-default" type="submit"&gt;Add Task&lt;/button&gt;
          &lt;/span&gt;
        &lt;/form&gt;
      &lt;ul class="todo-list"&gt;             
        &lt;li ng-repeat="task in project.tasks"&gt;
          &lt;input type="checkbox" ng-model="task.done"&gt;
          &lt;span ng-class="{done:task.done}"&gt;{{task.title}}&lt;/span&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>How can I push my data about task?</p>
  
  <p>This is doesn't work: </p>
  
  <pre><code>$scope.addTask = function(project){
  
    $scope.project.tasks.push({
      title: $scope.tasktitle, done: false
    });
  
  };
  </code></pre>