wizard-custom-step.js.es6 586 B

12345678910111213141516171819202122
  1. import { default as computed } from 'ember-addons/ember-computed-decorators';
  2. export default Ember.Component.extend({
  3. classNames: 'wizard-custom-step',
  4. @computed('step.fields.@each.id')
  5. allowAddAction: stepFields => stepFields.get('firstObject.id'),
  6. actions: {
  7. addField() {
  8. this.get('step.fields').pushObject(Ember.Object.create({ id: '', label: '' }));
  9. },
  10. addAction() {
  11. this.get('step.actions').pushObject(Ember.Object.create({ id: '', label: '' }));
  12. },
  13. removeField(field) {
  14. this.get('step.fields').removeObject(field);
  15. }
  16. }
  17. });