How to use the ember-form-builder/components/form-builder.extend function in ember-form-builder

To help you get started, we’ve selected a few ember-form-builder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nibynic / ember-form-builder / addon / components / form-builder / fields.js View on Github external
import FormBuilder from 'ember-form-builder/components/form-builder';
import { computed } from '@ember/object';

export default FormBuilder.extend({
  tagName: 'div',

  parentFormBuilder: computed('on.formBuilder', {
    get() {
      return this._parentFormBuilder || this.get('on.formBuilder') || this.get('on');
    },
    set(k, v) {
      return this._parentFormBuilder = v;
    }
  }),

  didInsertElement() {
    this._super(...arguments);
    this.get('parentFormBuilder').addChild(this.get('formBuilder'));
  },