aequos-solutions / modern-data-visualizer

Documentation for the Modern Data Visualizer solution
https://aequos-solutions.github.io/modern-data-visualizer/
7 stars 7 forks source link

Receiving r.inverse is not a function error #107

Closed tedtninety closed 1 year ago

tedtninety commented 1 year ago

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 1 year ago

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

tedtninety commented 1 year ago

Thank you Laul0!