wizard-custom-step.js.es6 624 B

1234567891011121314151617181920212223242526
  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) {
  6. console.log(stepFields)
  7. return stepFields.get('firstObject.id');
  8. },
  9. actions: {
  10. addField() {
  11. console.log('adding field')
  12. this.get('step.fields').pushObject(Ember.Object.create());
  13. },
  14. addAction() {
  15. this.get('step.actions').pushObject(Ember.Object.create());
  16. },
  17. removeStep() {
  18. this.sendAction('removeStep', this.get('step.name'));
  19. }
  20. }
  21. });