Hej guys,
I have the following problem. Here first the code:
{{#each this.example as |component|}}
{{#if-equal param1={{component.name}} param2="componentName"}}
{{coolcomponent}}
{{/if-equal}}
{{/each}}
explanation: i am going throw a object array and if i find a component name that equal the param2 then i want to use a spezific component.
i am getting a error because i cant do this {{component.name}} inside the {{#if-equal}}. Is there a way to get around this ? Or a other good solution to do this ?
P.S. the #if-equal just checks if param1 is equal param2
The examples above don’t set the HTML Element id. They pass an argument to the component named id. So inside the component.js, it’s available as this.id. You could change the name from id to anything else.