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

Template tag inconsistency using :each/:if #20

Closed
Swizz opened this issue Jun 27, 2024 · 4 comments · Fixed by #21
Closed

Template tag inconsistency using :each/:if #20

Swizz opened this issue Jun 27, 2024 · 4 comments · Fixed by #21

Comments

@Swizz
Copy link

Swizz commented Jun 27, 2024

Hi,
Thank you for bringing us Sprae.

Lately, I have noticed some unlikely behaviors regarding the use of the template tag especially using the :each and :if directives.
Following this given live example .

The :if directive seems not working at all in an :each block but only if this is used inside a template tag.
Even by including syntax error, no errors are shown, that leads me to think that the :if directive is not called at all.

Is this intended behavior ?

@dy
Copy link
Owner

dy commented Jun 27, 2024

Thanks for report, let me check. There is possible incompleteness of :if :each combo, I haven't yet discovered all possible cases.

@Swizz
Copy link
Author

Swizz commented Jun 27, 2024

I have also notified that directives order is truly important, that might be written in the doc.

This case will works :

<li :each="value in values" :text="value.name"></li>

But this one will raise a value is not defined error :

<li :text="value.name" :each="value in values"></li>

@dy dy mentioned this issue Jun 29, 2024
@dy dy closed this as completed in #21 Jun 29, 2024
@dy
Copy link
Owner

dy commented Jun 29, 2024

Fixed the issue, updated readme. Thanks for the feedback @Swizz!

Btw cool name, I used to make a package https://www.npmjs.com/package/swizz

@Swizz
Copy link
Author

Swizz commented Jul 1, 2024

Thank you for your work. The fix works like a charm.

This is a username I use since 20 years, and I do not remember where it comes ; but I do like how it sounds despite the meaning

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

Successfully merging a pull request may close this issue.

2 participants