aequos-solutions/modern-data-visualizer

Receiving r.inverse is not a function error

Closed this issue · 2 comments

Hi,
I'm trying to check if root.slots.Category is equal to a particular value.
If it is then it provides a URL

{{#if (eq @root.slots.Category "desiredValue")}}

{{else}}

{{/if}}

No matter what I do, I get r.inverse is not a function error.

Any help would be greatly appreciated.
Cheers

Laul0 commented

Hi @tedtninety,

Thank you for your question.
The part of the code that you mention is not totally correct. Your logic is good but is not how the Handlebars Helper works.

As mentioned in the documentation: "Block helper that renders a block if a is equal to b".

In other words, the current code looks like this:

if( if([your-condition]) {
      ...
    }) {
   ...
}

The correct code is:

{{#eq @root.slots.Category "desiredValue"}}

{{else}}

{{/eq}}

We hope this information will help you.

Thank you

Thank you Laul0!