#102 Computed Macro

Update: I made some corrections based on comments.

Let’s say you want to create a computed property to upper case another property, for example:

Let’s say you want to use this “upper” function in multiple places, you can convert it into a “computed macro”.

Create a macro in a subfolder e.g. utils or macros:

Create the helper:

Now, you can use that computed macro like this:

Don’t forget to import it:

This tip was inspired by the ember-awesome-macros addon.

Also published on Medium.

Published by

Emad Ibrahim

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