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

@ helper's don't work #776

Open
monsterlane opened this issue Sep 19, 2017 · 5 comments
Open

@ helper's don't work #776

monsterlane opened this issue Sep 19, 2017 · 5 comments

Comments

@monsterlane
Copy link

monsterlane commented Sep 19, 2017

Is this nested structure supposed to work?

feed.dust

{#activities}
	{@select key=category}
		{@eq value="event"}{>"views/snapshot/event"/}{/eq}
	{/select}
{/activities}

event.dust

<div class="row activity {name} {category} reset-lineheight">
	<div class="col-xs-1">
		<span class="svg {icon_class}"></span>
	</div>

	<div class="col-xs-11">
		<header>
			<i class="text-muted text-note">{@gt key=counter value="1" type="number"}{strings.last_time} {/gt}{formatted_datetime}</i>
		</header>
	</div>
</div>

Inside the partial event none of the @ helpers function correctly. If I output {counter} or do a context dump the correct value appears. In case it was a type issue I added a string property with a static value and did an @eq test on it which also failed to produce output. {:else} blocks are also not displayed it's as if the entire condition is stripped somehow.

Is this a bug? If I change the @select in the parent view to @eq checks the @ helpers inside event do function as you'd expect them to. The reason it's an @select is because there are about 10 different views depending on the value of category.

@hegdeashwin
Copy link

I have similar issue with Node.js 8.8.1 version

    <div>Hello World</div>
    {@eq key="true" value="true"}
        <div>Hello 1</div>
        {:else}
        <div>Hello 2</div>
    {/eq}

{@eq} is not executing at all when I switch to Node.js 6.10.2 ... things just work fine.

@snehasis419
Copy link

snehasis419 commented Dec 7, 2017

We are facing the same issue as mentioned by @hegdeashwin
@monsterlane what is the node version you are using? Also, are you using dust on server-side templating?

@kumarrishav
Copy link

yeah. It's blocking us to migrate to node 8

@hegdeashwin
Copy link

@kumarrishav have fixed the node 8 bug here ...
can anyone please help us to merge the PR?

@sethkinast
Copy link
Contributor

sethkinast commented Dec 7, 2017 via email

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

No branches or pull requests

5 participants