It is a Ember addon to allow more flexibility on the conditional manipulation in handlebars (such as: equal, less than, greater than, isEmpty, etc)
- ember install ember-handlebars-conditions
Helper | Logic | Syntax | Remarks |
---|---|---|---|
eq | if (a==b) |
{{ if (eq a b) }} |
Non-strict comparison |
seq | if (a===b) |
{{ if (seq a b) }} |
Strict comparison |
not | if (!a) |
{{ if (not a) }} |
--- |
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) }} |
--- |
and | if (a && b) |
{{ if (and a b) }} |
--- |
or | if (a || b) |
{{ if (or a b) }} |
--- |
xor | if (!a && b || !b && a) |
{{ if (xor a b) }} |
--- |
isBlank | if (Ember.isBlank(a)) |
{{ if (isBlank a) }} |
--- |
isEmpty | if (Ember.isEmpty(a)) |
{{ if (isEmpty a) }} |
--- |
isNone | if (Ember.isNone(a)) |
{{ if (isNone a) }} |
--- |
ember serve
- Visit your app at http://localhost:4200.
npm test
(Runsember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit https://ember-cli.com/.