diff --git a/addon/components/dynamic-form.js b/addon/components/dynamic-form.js index 889bb76..fff0a57 100644 --- a/addon/components/dynamic-form.js +++ b/addon/components/dynamic-form.js @@ -19,16 +19,14 @@ const DynamicForm = Ember.Component.extend({ formRenderer: null, init() { - let renderer = this.get('_renderer'); - if (!renderer) { - let container = getOwner(this); - let config = container.resolveRegistration('config:environment'); - if (config.dynamicForms && config.dynamicForms.renderer) { - renderer = container.lookup(`${config.dynamicForms.renderer}:dynamic-forms.renderers`); - } else { - renderer = container.lookup('alpaca:dynamic-forms.renderers'); - } - + this._super(...arguments); + let container = getOwner(this); + let config = container.resolveRegistration('config:environment'); + if (config.dynamicForms && config.dynamicForms.renderer) { + set(this, 'formRenderer', container.lookup(`${config.dynamicForms.renderer}:dynamic-forms.renderers`)); + } else { + set(this, 'formRenderer', container.lookup('alpaca:dynamic-forms.renderers')); + } }, _render() {