@armikhalev wrote:
I have encountered a problem with filtering in templates when I'm trying to show items only once instead of repeating the same item, though coming as a different property. It is easier to show in code:
{{#each gCard as |card|}} Category: {{ card.category }} <ul> <li><b>{{ card.title }}</b></li> <li>{{ card.body }}</li> <li>{{ card.comment }}</li> </ul> {{/each}}
This results in category header being repeated several times like this:
Category: first cat
title
body
commentCategory: first cat
title
body
commentCategory: second cat
title
body
commentI don't want "first cat" to be repeated twice, only once, like this:
Category: first cat
title
body
commenttitle
body
commentCategory: second cat
title
body
commentIs it achievable within template or I should deal with data in controller? What would be the Ember way of solving this problem?
Thank you
Posts: 5
Participants: 3