dimanche 6 août 2017

Angular delete button with Laravel controller

I have list of appointments in my database and I want to add a delete button for each appointment so when the delete button is licked the appointment gets deleted.

HTML Code

'              <td>\n' +
'               <a >Delete</a> </td>\n'+
'            </tr>\n' +

this is the delete button

Route.php

$api->delete('appointments/del', 'AppointmentsController@delete_appointment');

I have added this route in laravel.

AppointmentsController.php

public function delete_appointment(){
    console.log("delete");
}

now I am unable to call this function on the button click. I have tried ng-click and href ethod too, but no success.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2vtW2aw
via IFTTT

Aucun commentaire:

Enregistrer un commentaire