title: Using $http in angular jhipster entities
body: <p>What is the proper way to update some entity field from Angular view/controller.</p>
  
  <p>Let's imagine we have a"to-do" app in which we want to change "Task" entity status from 1 to 0 from a ng-click event and store that change in the database.</p>
  
  <p>How can we create that functionality in our controller so we can call it when checking/unchecking a checkbox?</p>
  
  <p>Lets set the playground:</p>
  
  <pre><code>&lt;div ng-repeat="task in tasklist.tasks"&gt;
  
      &lt;checkbox ng-change="completeTask({{taskId:task.id}})"&gt;&lt;/checkbox&gt;
      &lt;span&gt;{{task.title}}&lt;/span&gt;  
  
  &lt;/div&gt;
  </code></pre>
  
  <p>In Controller we want to change "task.status" from 1 to 0 or viceversa when checkbox click:</p>
  
  <pre><code>    //If we need to obtain that task object from api
      var task = Task.get({id : $stateParams.taskId}).$promise;
  
      //Now how should the function work?
  
          $scope.completeTask = function () {
  
  
  
  
          };
  </code></pre>