hbs-helper
Version:
handlebar template engine's helper
89 lines (55 loc) • 1.32 kB
Markdown
this repo list some hbs helpers.
maybe you will need it when you create the can.
if condition.
example:
```hbs
{{
show when true
{{/ifCond}}
```
please read the code to know more.
compare multiple variable with 'or' condition
example:
```hbs
{{
show text when one of var is true
{{/multiOr}}
```
You can use as many variables as you can.
Even
example:
```hbs
{{
{{
show if even
{{/ifEven}}
{{each}}
```
Odd
example:
```hbs
{{
{{
show if even
{{/ifOdd}}
{{each}}
```
use to return the proper string based on the different length of array.
For example:
{{gridValue 1}} => "col-md-12 sm-col-12"
{{gridValue 5}} => "col-md-3 sm-col-6"
You can change the different grid value in your canner can.
use to return the proper string based on the existing key.
For example:
now has these key-value => a: false, b: true, c: true
{{gridValueKey a b c}} => "col-md-6 sm-col-6" //cause the true key is b & c
You can change the different grid value in your canner can.