New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riot-tag as expression in loop #1368

Closed
marvinroger opened this Issue Nov 19, 2015 · 2 comments

Comments

Projects
None yet
4 participants
@marvinroger

marvinroger commented Nov 19, 2015

Hi,

Given:

var nodes = [{ type: "customtag" }];

The following doesn't render the tag:

<div riot-tag="{ type }" each="{ nodes }"></div>

However, replacing manually the riot-tag with the name of the tag does work.

Am I doing something wrong?

@lloydzhou

This comment has been minimized.

Show comment
Hide comment
@lloydzhou

lloydzhou Nov 20, 2015

you can try to call riot.mount() on "mount" event:

<div class="sub_class" riot-tag={ type } each={ nodes }>
this.on('mount', function(){
    riot.mount('.sub_class')
})

lloydzhou commented Nov 20, 2015

you can try to call riot.mount() on "mount" event:

<div class="sub_class" riot-tag={ type } each={ nodes }>
this.on('mount', function(){
    riot.mount('.sub_class')
})
@marvinroger

This comment has been minimized.

Show comment
Hide comment
@marvinroger

marvinroger Nov 23, 2015

Thanks, it works. But now, the problem is passing an object through attribute doesn't work. (e.g <div riot-tag="{ type }" each="{ nodes }" object={ object }></div>. I don't have access to opts.object from the tag. Again, replacing manually riot-tag with the name of the tag corrects the issue.

marvinroger commented Nov 23, 2015

Thanks, it works. But now, the problem is passing an object through attribute doesn't work. (e.g <div riot-tag="{ type }" each="{ nodes }" object={ object }></div>. I don't have access to opts.object from the tag. Again, replacing manually riot-tag with the name of the tag corrects the issue.

@rsbondi rsbondi self-assigned this Dec 19, 2015

@GianlucaGuarini GianlucaGuarini added this to the 3.0.0 milestone Jul 23, 2016

@rsbondi rsbondi removed their assignment Jul 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment