Handy conditionals in Ember templates with Ember Truth Helpers

Handlebars was ‘logic-less’ for a long time. Later with HTMLBars arrival, Handlebars became more liberal. Still, some handy features are missing. Ember Truth Helpers gives us some ‘syntactic sugar’ in the form of conditional helpers, that Handlebars don’t.

{{#if (eq post.author.name 'Wojtek')}}
  {{#link-to 'post' post tagName='li'}}<a>{{t 'shared.labels.superPost'}}</a>{{/link-to}}

Ember Truth Helpers gives us more helpful helpers. Refer to the project repo for more information

This protip has been written in 848 seconds