1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/controllers/admin-wizard.js.es6
2017-09-24 11:01:18 +08:00

26 Zeilen
534 B
JavaScript

export default Ember.Controller.extend({
actions: {
save() {
this.get('model').save().then(() => {
this.transitionToRoute('adminWizardsCustom');
});
},
remove() {
this.get('model').remove().then(() => {
this.transitionToRoute('adminWizardsCustom');
});
},
addStep() {
this.get('model.steps').pushObject({
fields: Ember.A(),
actions: Ember.A()
});
},
removeStep(step) {
this.get('model.steps').removeObject(step);
}
}
});