Component block scope in templates


#1

I’ve got a template that looks like this:

each searchData as |canonicalProduct|
  = item-select tagName='tr' selectedItem=selectedMatch action='match' item=canonicalProduct
    td = canonicalProduct.make
    td = canonicalProduct.model
    td = canonicalProduct.year
    td = canonicalProduct.finish

The ‘item-select’ component.js file has a property ‘selected.’ I want to write a conditional statement for ‘selected’ and display something. I don’t want to write a template file for this. How do I reference properties off a component in this manner?


#2

{{#if selected}} display something {{/if}} For more advanced conditionals, I recommend using ember-truth-helpers