title: Have to call angular service twice in order for it to call my api
body: <p>I've started writing code in angular and seem to have gotten stuck. I have created a simple service that will call my API to delete an item in a database. I am calling my service that I created the following way:</p>
  
  <pre><code>studentService.del(
    { token: localStorage.getItem('token'), studentId: studentInfo.studentId },
    function (result) {
      console.log('im in delete FE callback');
      if (result[0].studentDeleted) {
          $scope.showSimpleToast('Deleted');
      }
    }
  )
  </code></pre>
  
  <p>The weird thing that occurs with this is that both my service and the call to the service works. If i hit the delete button to remove a student the request will be made, but will not call the api for ~15 seconds, I'll get a status of pending in my chrome console. however, if i click the delete button twice it will delete the student instantly (no pending period). Does anyone have an idea as to why this could be occurring so i could investigate into it?</p>
  
  <p>Important things to note:</p>
  
  <ol>
  <li>Angular version - 1.5.8</li>
  <li>using $resource for my restful API call</li>
  <li>i have console logs in my function that calls studentService.del, i see that I'm entering the function when i click delete, but i do not see the log statement for the API or front end within the callback of the function the console log that I am not seeing is labeled as "I'm in delete FE callback". I will eventually see this and the API log statement if i wait ~15 seconds, or call the function twice.</li>
  </ol>
  
  <p>I use an ng-repeat to populate a list of students and read that perhaps its taking so long to execute because it is not executing until the next $digest cycle, I'm not sure if this is happening or not, but is this a possibility? if so how would i go about fixing this?</p>