I just started learning AngularJS and will be using PHP for the backend.
I got the basics of Angular working, but now I'm at the point of form submission. Now I'm thinking that I could just do an $.ajax({...});
call to a PHP file and include that function at the bottom of my view.
However, I see there are other ways using controllers, which I'm researching; I just want to know if that would be considered bad practice or if there is a simple way to transition from one method to the other.
Thanks.
EDIT:
Here's what I did now and it's working great in my opinion. Doesn't hurt the integrity of Angular, the form submits, and all is good. Is there a downside to this:
function submitNewPatient(){
$.ajax({
url: 'ajax/patients/new_patient.php',
type: 'post',
data: $("#new_patient_form").serialize(),
success: function()
{
$("#new_patient_form")[0].reset();
}, error: function()
{
alert('something went wrong');
}
});
}