Skip to content
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

if directive inside foreach directive #101

Open
jbruni opened this issue Aug 12, 2021 · 3 comments
Open

if directive inside foreach directive #101

jbruni opened this issue Aug 12, 2021 · 3 comments
Assignees
Labels

Comments

@jbruni
Copy link
Contributor

jbruni commented Aug 12, 2021

Consider this template:

<li *foreach="{{ this.items }}">
  <a href="{{ item.url }}">{{ item.name }}</a>
  <p *if="{{ item.foo }}">bar</p>
</li>

While item.url and item.name render as expected... the item within the *if is always undefined.

I'm not sure if this is expected, or a bug, or how to make it work as intended. Any help is appreciated.

Thanks!

@eavichay
Copy link
Member

It looks like a bug, as the parser should postpone the *if until the item context is ready.
I'll look into it.

@eavichay eavichay self-assigned this Aug 22, 2021
@eavichay eavichay added the bug label Aug 22, 2021
@arfelarfe
Copy link

Hi,
@eavichay Any progress on this?
Btw: thanks for a great framework :)

@mateusz-lisik
Copy link

Would love to use it too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants