HTMLBars template helpers for additional truth logic in if
and unless
statements.
Helper | JavaScript | HTMLBars |
---|---|---|
eq | if (a === b) |
{{if (eq a b)}} |
not-eq | if (a !== b) |
{{if (not-eq a b)}} |
not | if (!a) |
{{if (not a)}} |
and | if (a && b) |
{{if (and a b)}} |
or | if (a || b) |
{{if (or a b)}} |
xor | `if (a && !b | |
gt | if (a > b) |
{{if (gt a b)}} |
gte | if (a >= b) |
{{if (gte a b)}} |
lt | if (a < b) |
{{if (lt a b)}} |
lte | if (a <= b) |
{{if (lte a b)}} |
is-array | if (Ember.isArray(a)) |
{{if (is-array a)}} |
ember install ember-truth-helpers
git clone https://github.com/jmurphyau/ember-truth-helpers.git
npm install
bower install
ember server
- Visit your app at http://localhost:4200.
npm test
(Runsember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.