How to add value to ng-model in angularjs. my html is:
<textarea rows="5" ng-model="comment.comment_text"></textarea>
<input type="hidden" ng-model="comment.task_id" value="{{task.id}}">
<input type="hidden" ng-model="comment.user_id" value="{{profile.id}}">
<button type="submit" class="btn btn-success" ng-click="create(comment)">Send</button>
and angular controller:
$scope.create = function(comment) {
console.log(comment);
};
when click on button show result in console:
{comment_text: "test"}
BUT I want to show like this:
{comment_text: "test", user_id:1 ,task_id:53}
comment.user_id