Simple I:R question

is iron routers data: -> option basically a replacement for the usual Template helper? I noticed

Template.mainview.helpers hello: () -> text = 'hello' return text

and then adding {{hello}} didnt work with iron router, but then using

data: -> hello: 'hello' in the route did work. Is this data option used like a regular template helper?

No, the data function should return the data context the template should be rendered with, and you can still use ordinary helpers (why it doesn’t work in your case I can’t say without seeing more code).

1 Like

Edit: fixed, guess it was a spacing issue as c+p the helpers back in fixed it.