minutebase / ember-dynamic-component

Ember addon to render a dynamic component
MIT License
40 stars 4 forks source link

Component's bound properties initializing with null value #2

Closed trampos closed 9 years ago

trampos commented 9 years ago

Well, my english is not so good, but ill try to explain what was my issue.

The component dynamically loaded by yours were getting initialized before the bound properties get set. Just check the bound properties of the dynamically loaded component on init (or didInsertElement) callback to see the issue, you will see that its all null.

I don't know if its ok, but this fix worked for me,

i've changed the line 42 from: return customComponent.create(props); to: return this.createChildView(customComponent, props);

jscadden commented 9 years ago

Same issue when using Ember.computed helpers:

    //components/my-dynamic-component.js
    export default Ember.Component.extend({
        foo: Ember.computed.alias('boundproperty.bar'),
    });
rlivsey commented 9 years ago

Interesting, any chance you can provide a failing test which this fixes?

I'll take a look myself asap but am away this weekend and can't spend much time on my computer!

Serabe commented 9 years ago

This bug makes imposible to use tagNameBinding on components.

rlivsey commented 9 years ago

Some tests are failing on Travis, I'll get those sorted and then release a new version with this change in

Serabe commented 9 years ago

Great work! :+1:

rlivsey commented 9 years ago

The test failures seem unrelated to this change, so I've published v0.0.4 and will try and figure out what's causing the issues later.

trampos commented 9 years ago

Nice! tks