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

Exposed event parameters indexed property #302

Open
tzapu opened this issue Jun 29, 2021 · 3 comments
Open

Exposed event parameters indexed property #302

tzapu opened this issue Jun 29, 2021 · 3 comments

Comments

@tzapu
Copy link

tzapu commented Jun 29, 2021

hi

is there a way to tell in the template if an event's parameter was indexed or not?

thanks you

@frangio
Copy link
Contributor

frangio commented Jun 29, 2021

Not directly, but you can do it by accessing the AST node of the event definition. Something like this should work:

{{#each ownEvents}}
{{#each astNode.parameters.parameters}}
{{#if indexed}}
indexed
{{/if}}
{{/each}}
{{/each}}

See here for reference on the AST node for each parameter, including the indexed property.

@frangio frangio changed the title indexed parameters lookup for events Exposed event parameters indexed property Jun 29, 2021
@tzapu
Copy link
Author

tzapu commented Jun 29, 2021

thank you very much @frangio
i was able to read it like this {{#with (lookup ../astNode.parameters.parameters @index)}}{{#if indexed}}:white_check_mark:{{/if}}{{/with}}

not sure if you want this issue closed or left to expose it later on

@frangio
Copy link
Contributor

frangio commented Jul 1, 2021

Let's leave it open, it would be nice to expose this somehow.

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

2 participants