can-stache
Version:
Live binding handlebars templates
33 lines (22 loc) • 910 B
Markdown
-stache.helpers.not not
can-stache.htags
`{{# not(EXPRESSION) }} TRUTHY {{else}} FALSY {{/not}}`
Renders `TRUTHY` if `EXPRESSION` is falsy or `FALSY` if `EXPRESSION`
is truthy. Both `TRUTHY` and `FALSY` will be rendered with the
current scope.
```html
{{# not(person.isAwake()) }} Shhhhh! {{/ not }}
```
{can-stache/expressions/key-lookup|can-stache/expressions/call} EXPRESSION A lookup expression that will provide a truthy or falsey value.
{can-stache.sectionRenderer} FN A subsection that can be optionally rendered.
{can-stache.sectionRenderer} [INVERSE] An optional subsection that will be rendered
if `EXPRESSION` is truthy and [can-stache.helpers.else] is used.
## Use
The `not` helper evaluates the inverse of the value
of the key and renders the block between the helper and the slash.
```html
{{#not(expr)}}
// not
{{/not}}
```
can