Clientjs users should be able to add a script to a scripts arg, for templates within a namespace.
Possible syntax:
app.get('templater').templateContext({extraArgs}, 'namespace-prefix')
or
app.get('templater').on('templateContext', (name, req) => { return {extraArgs} })
In either case, templater will need to do additional work to smartly merge the returned objects, likely including merging arrays. Will need to get req available to templater to handle the callback (users) case, or generally do these as afters and have router inject req to the event.
Use cases:
user
to all templates.scripts
arg, for templates within a namespace.Possible syntax:
app.get('templater').templateContext({extraArgs}, 'namespace-prefix')
orapp.get('templater').on('templateContext', (name, req) => { return {extraArgs} })
In either case, templater will need to do additional work to smartly merge the returned objects, likely including merging arrays. Will need to get
req
available to templater to handle the callback (users) case, or generally do these as afters and have router inject req to the event.