Meteor Template helpers
Features:
๐จโ๐ฌ 100% tests coverage;๐ก Lightweight - No external dependencies, all feature helpers has only weak dependencies;โ๏ธ Compare values with conditions -{{#if compare one '===' two}} ... {{/if}}
;๐ Get/set Session (weak dependency) -{{Session 'key' set='value'}}
,{{#if Session 'key'}} ... {{/if}}
;๐จ Use underscore's functions (weak dependency) -{{#if _ 'isString' 'one'}} ... {{/if}}
;๐จโ๐ป Debug/log passed objects as a string to template -{{log this.someVal 'string' object="value"}}
.
Install:
meteor add ostrio:templatehelpers
Helpers
Use comparison, conditional, and logical operations right in the Blaze templates. Get access to Session
object ans stored values. Execute underscore
package methods. And debug Blaze templating data using log
helper.
Session
Get or set session value from views via Session helper
log
Template debugging - Log arguments into browser's console with output into template
Underscore (all methods)
Execute underscore methods in template
Comparison helpers
Compare template data. Create conditional if
and unless
blocks.
Compare two values in template
Compare many to many
Compare complex template data.
Compare one value to many (any of.. match)
Compare single value against many (any of.. match).
Running Tests
- Clone this package
- In Terminal (Console) go to directory where package is cloned
- Then run:
Meteor/Tinytest
# Default
meteor test-packages ./
# With custom port
meteor test-packages ./ --port 8888
Support our open source contribution
- Sponsor via GitHub
- Support via PayPal
- Use ostr.io โ Monitoring, Analytics, WebSec, Web-CRON and Pre-rendering for a website