Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/jaaaco/template-logic
- Owner: jaaaco
- Created: 2016-01-16T11:44:48.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-16T11:46:23.000Z (almost 9 years ago)
- Last Synced: 2023-03-25T19:28:04.069Z (over 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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