wizard-custom-field.js.es6 523 B

123456789101112131415161718192021
  1. import { observes } from 'ember-addons/ember-computed-decorators';
  2. export default Ember.Component.extend({
  3. classNames: 'wizard-custom-field',
  4. fieldTypes: ['dropdown', 'image', 'radio', 'text', 'textarea'],
  5. isDropdown: Ember.computed.equal('field.type', 'dropdown'),
  6. choices: Ember.A(),
  7. @observes('field.label')
  8. setFieldId() {
  9. const label = this.get('field.label');
  10. console.log('setting id')
  11. this.set('field.id', Ember.String.underscore(label));
  12. },
  13. actions: {
  14. addChoice() {
  15. }
  16. }
  17. });