diff --git a/addon/components/dynamic-form.js b/addon/components/dynamic-form.js index 83f9142..281156d 100644 --- a/addon/components/dynamic-form.js +++ b/addon/components/dynamic-form.js @@ -22,9 +22,9 @@ const DynamicForm = Ember.Component.extend({ let renderer; let config = container.resolveRegistration('config:environment'); if (config.dynamicForms && config.dynamicForms.renderer) { - renderer = container.lookup(`${config.dynamicForms.renderer}:renderers`); + renderer = container.lookup(`${config.dynamicForms.renderer}:dynamic-forms.renderers`); } else { - renderer = container.lookup('alpaca:renderers'); + renderer = container.lookup('alpaca:dynamic-forms.renderers'); } renderer.render(this.get('renderSchema'), this.$()); }, diff --git a/addon/dynamic-forms/form-factories/ember-default.js b/addon/dynamic-forms/form-factories/ember-default.js new file mode 100644 index 0000000..fbd1588 --- /dev/null +++ b/addon/dynamic-forms/form-factories/ember-default.js @@ -0,0 +1,12 @@ +import Ember from 'ember'; + +const TYPE_MAP = { + text: '', + radio: '' +}; + +export default Ember.Object.extend({ + componentFor(type) { + + } +}); diff --git a/addon/dynamic-forms/renderers/alpaca.js b/addon/dynamic-forms/renderers/alpaca.js new file mode 100644 index 0000000..5c212df --- /dev/null +++ b/addon/dynamic-forms/renderers/alpaca.js @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +export default Ember.Object.extend({ + render(schema, element) { + element.alpaca(schema); + } +}) diff --git a/addon/dynamic-forms/renderers/ember.js b/addon/dynamic-forms/renderers/ember.js new file mode 100644 index 0000000..71f33bf --- /dev/null +++ b/addon/dynamic-forms/renderers/ember.js @@ -0,0 +1,11 @@ +import Ember from 'ember'; + +export default Ember.Object.extend({ + render(schema, element) { + // iterate fields in schema + + // load component equivs from factory + + // attach to DOM or parent component + } +}); diff --git a/app/dynamic-forms/renderers/alpaca.js b/app/dynamic-forms/renderers/alpaca.js new file mode 100644 index 0000000..72e61bf --- /dev/null +++ b/app/dynamic-forms/renderers/alpaca.js @@ -0,0 +1,3 @@ +import Alpaca from 'ember-cli-dynamic-forms/dynamic-forms/renderers/alpaca'; + +export default Alpaca;