title: Dynamic ng-init set value in Angularjs
body: <p>I want to initiate <code>ng-init</code> on page load. I have <code>task.id</code> that fetch with <code>Restangular</code> and my html is:</p>
  
  <pre><code>&lt;textarea rows="5" ng-model="comment.comment_text"&gt;&lt;/textarea&gt;{{task.id}}
  &lt;input type="hidden" ng-model="comment.task_id" ng-init="comment.task_id = $scope.task.id"&gt;   
  &lt;button type="submit" class="btn btn-success" ng-click="create(comment)"&gt;Send&lt;/button&gt;
  </code></pre>
  
  <p>and angular controller:</p>
  
  <pre><code>$scope.create = function(comment) {
       console.log(comment);
  };
  </code></pre>
  
  <p>When click on button show result in console:</p>
  
  <pre><code>{comment_text: "test", task_id: undefined }
  </code></pre>
  
  <p>But I want to show like this:</p>
  
  <pre><code>{comment_text: "test" ,task_id:53}
  </code></pre>