Update sfService Again

Once again we began by adding a new function to our sfService this time called del. Let’s place it after our create function in the public function section. The del function will call getDataService and eventually return the promise created by forsejs‘s del function. We will also update our return object to expose the del function. Once we are done we will the changes should look something like this:

Now that the service is up to date we can call del from the contact-detail component.

Update contact-detail Component

Since we are goign to add the option to delete a contact in the section where we display the contacts details we will need to add a button to the template. I added it as the last item after the row for edit button a row for the delete button that has it’s click bound to a method named deleteContact:

deleteContact in app/components/contact-detail.js

Let’s Delete Something!

Now we should be able to run the app and delete a contact.

Delete Contact

Conclusion

That seems to sum up the basic needs we may encounter with our little app. Is there any thing you think should be added or feel left out for not seeing? Let me know by leaving a comment below or emailing brett@wipdeveloper.com.