In my controller I now have:
$http.post('/api/agendainsert', { appointment_datetime: appointment_date + appointment_hour, profile: profile, column_id: column_id })
.success(function(data, status, headers, config){
$state.go('form.success');
})
.error(function(data, status, headers, config) {
console.log("Data: " + data +
"<hr />status: " + status +
"<hr />headers: " + headers +
"<hr />config: " + config);
});
};
Is there a function that I can use when the $http.post STARTS? So I can show a preloader on my screen and hide it when the data is successful pulled.