Function
helper (helper) public
Module:
@ember/component
Defined in packages/@ember/-internals/glimmer/lib/helper.ts:247
Available since v1.13.0
import { helper } from '@ember/component/helper'; |
- helper
- Function
- The helper function
In many cases it is not necessary to use the full Helper
class.
The helper
method create pure-function helpers without instances.
For example:
currency.js | |
1 2 3 4 5 |
import { helper } from '@ember/component/helper'; export default helper(function([cents], {currency}) { return `${currency}${cents * 0.01}`; }); |