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

Access @key inside a custom helper #44

Open
J05HI opened this issue Oct 30, 2017 · 4 comments
Open

Access @key inside a custom helper #44

J05HI opened this issue Oct 30, 2017 · 4 comments

Comments

@J05HI
Copy link

J05HI commented Oct 30, 2017

Hello @nolimits4web,

How can I access the "@key" inside of the "inArray" helper?

{{#each manyItems}}        
    {{#inArray 'something' this.itemName}}
        {{../@key}} <!-- This works -->
        {{../@index}} <!-- This works, too -->
        {{@root.someItems[../@key].id}} <!-- This doesn't work. How to access the ../@key here? -->
    {{/inArray}}
{{/each}}

Hope you can help me ;)

@J05HI J05HI changed the title Access @key & @index inside a custom helper Access @key inside a custom helper Oct 30, 2017
@J05HI
Copy link
Author

J05HI commented Dec 5, 2017

@nolimits4web
Any solution?

@nolimits4web
Copy link
Owner

It won't work. Just pass @key as the helper argument and do the logic inside of helper handler

@J05HI
Copy link
Author

J05HI commented Dec 5, 2017

@nolimits4web
Yeah but would be better to use it like in my example.
I don't want to use that bad work arounds.

@web-monster
Copy link

Before last update work {{../../this.users.usersData.@key.logo}} , after update dont work! {{../../users.usersData.@key.logo}}, @key not parse.

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

3 participants