Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4826

Component with dynamic layout

$
0
0

@koopa wrote:

I am trying to render a component with a dynamically compiled layout.

Here is an example that shows nicely what I am trying to accomplish:
https://ember-twiddle.com/81d0a068109c89d0a4846f3aad52ce40

Upon clicking the button, somevalue updates to "bar", but not the whole layout gets updated.

On the third line in the rendered output it still says "foo hello" but I expected it to change to "bar hello" as the layout should be updated to this.get('somevalue') + ' hello {{some-component somevalue=somevalue}}'; as seen in the code for the dyn-layout component.

Is it possible this behaviour was different a while ago and now changed? I thought it has maybe to do with caching or something preventing the compiled layout from being updated/overwritten. Tried to figure out more but ended up going deeper down the rabbit hole than I intended to and also realized that I was in way over my head.

What am i doing wrong here? Ultimately I'd like a component where I can pass in a string that will serve as the layout of this component. That means this string can also contain handlebars code and sub-components (like for example a tooltip component to explain certain abbreviations in the string that was originally passed).

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles