Closed grofit closed 9 years ago
Vash helpers need to be present in whatever context a template is being rendered within. So if you're doing clientside rendering of vash templates, then those helpers need to be registered with the clientside vash runtime.
I'm not sure how you're generating your clientside bundle. But whenever you include the vash runtime is the time when you'd also create a helper that outputs a static new relic string.
I'm going to close this, but feel free to reopen if you'd like more help!
I am trying to get NewRelic page loading timers into my vash templates so as the newrelic object lives in the server I thought it would be a good reason to use helpers:
So I put this in my server side code:
Now if I call this in the template:
It just blows up saying that object is not a function, so I am assuming the helper has not connected up correctly, but when reading the docs it kinda implies that the logic for helpers comes from a script file or script tag, which would exist within the template.
So can helpers be used the way I am showing above, if not is there a way I can pass the content of getBrowserTimeingHeader into the templates without explicitly putting it on each model?