Useful template helpers.
Included helpers:
Template
- access to currentTemplate.instance()
settings
- access toMeteor.settings.public
session
- access toSession
imageLoaded
- check whether the image is loaded.imageLoading
- check whether the image is in the process of loading.
meteor add sunstory:meteor-template-helpers
Template
:
Template.example.onCreated ->
@instanceVariable = 'one'
@reactiveVariable = new Blaze.ReactiveVar
@reactiveDict = new ReactiveDict
@instanceObject =
first: 'Mercury'
second: 'Venus'
Meteor.call 'someMethod', =>
@reactiveVariable.set 'two'
@reactiveDict.set
foo: 'three'
bar: 'four'
settings
:
{
"public": {
"twitterName": "elonmusk",
"twitterUrl": "https://twitter.com/elonmusk"
}
}
{
"public": {
"twitter": {
"name": "elonmusk",
"url": "https://twitter.com/elonmusk"
}
}
}
session
:
Session.set('planet', 'Earth')
Session.set('planets', { first: 'Mercury', second: 'Venus' })
imageLoaded
, imageLoading
:
- 19 Oct 2015: added
imageLoaded
andimageLoading
helpers.