Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jaaaco/template-logic

Basic logical operation helpers for Meter Blaze templates
https://github.com/jaaaco/template-logic

Last synced: 6 days ago
JSON representation

Basic logical operation helpers for Meter Blaze templates

Awesome Lists containing this project

README

        

Basic comparsion and logical operations for Meteor Blaze Templates

Install
-------

Inside your project folder run:

```
$ mrt add jaaaco:template-logic
```

Usage
-----

Helpers can be used as conditions in #if and #unless statements:

```html
{{#if _eq status 'active'}}
... html when object status == 'active'
{{/if}}
```

Available helpers
--------
* _eq value1 value2 - returns true when value1 == value2
* _gt value1 value2 - true when value1 > value2
* _gte value1 value2 - true when value1 >= value2
* _lt, _lte - you probably get it now
* _and value1 value2 - true when value1 && value2
* _or value1 value2 - true when value1 || value2
* _not - true when !value1
* _in value1 value2 [value_N] - true when value1 equals value2 or any of next passed values