title: loopback model hooks not working
body: <p>I am currently working on an appointment booking app using loopback, below is my appointment.js from the common/model directory </p>
  
  <pre><code>module.exports = function(Appointment) {
  
  
    Appointment.afterCreate = function (next) {
        //TODO add appointment details should not be hardcoded get users email here
        var emailService = require('../../common/services/email.server.service');
        emailService.sendUserEmail('dummy@dummy.com');
        next();
    };
  
    Appointment.beforeUpdate = function(next) {
        var emailService = require('../../common/services/email.server.service');
        if(this.appointmentStatus === 'waiting_agent'){
            console.log(this.appointmentStatus);
        } else if(this.appointmentStatus === 'waiting_user'){
            console.log(this.appointmentStatus);
        } else {
            console.log(this.appointmentStatus);
        }
  
        emailService.sendUserEmail('dummy@dummy.com');
  
        next();
  
    };
  };
  </code></pre>
  
  <p>The afterCreate function works well and sends out an email, however afterUpdate/beforeUpdate doesnt work, I am using Angular as front end and using Angular loopback to generate services, and below is the update function : </p>
  
  <pre><code>function updateAppointment(listingId,newAppointmentInfo,status){
      Appointment.updateAll(
          {
              where:
              {
                  listingId : listingId
              }
          },
          {
              "appointmentDate": newAppointmentInfo.selectedDate,
              "appointmentTime" : newAppointmentInfo.selectedTime,
              "appointmentStatus" : status
          },
          function (appointment){
              console.log(appointment);
          },
          function (err){
              console.log(err);
          }
      )
  }
  </code></pre>
  
  <p>Is it because I am calling the /Appointment/update api rather then UPDATE on /Appointment ? </p>