I have a component with an action. After the action has occurred, I'd like to send a PATCH request to an API endpoint. /posts/{id}.
How is this accomplished?
My component code app/components/post.js:
import Ember from 'ember';
export default Ember.Component.extend({
isLiked: false,
actions: {
toggleLiked() { this.toggleProperty('isLiked'); }
}
});
Aucun commentaire:
Enregistrer un commentaire