code
import Ember from 'ember'; export default Ember.Component.extend({
editing: false,
actions: {
editTodo() {
this.toggleProperty("editing");
},
submitTodo() {
const todo = this.get("todo");
if (todo.get("title") == "") {
todo.destroyRecord().then(() => {
this.toggleProperty("editing");
});
} else {
this.toggleProperty("editing");
}
},
deleteTodo() {
this.get("todo").destroyRecord();
}
}
});
how this 'editing' property get into action, can anyone please explain? I'm new to ember
Aucun commentaire:
Enregistrer un commentaire