#19 Truth Helpers

Tip

We have all created one-use computed properties so we can have simple conditionals in our template e.g.

This requires 2 computed properties like:

With the addon ember-truth-helpers you can avoid creating the isSenior and isUnderAge computed properties and simply do this in your template:

There are many more operators and you can even combine them with ands and ors.

Credit

Thanks to https://til.hashrocket.com/posts/d85a160f10-ember-truth-helpers-and-htmlbars-sub-expressions for this tip.

Some Love ❤❤❤

If you are enjoying my daily tips please spread the word with this one-click tweet.
If you do NOT like the tips then please reply to this email and let me know.

Published by

Emad Ibrahim

Author of asp .net MVC & TDD, entrepreneur, passionate technologist, programmer and productivity nut. more at http://t.co/oSJXPvzu