Inject Methods/Object with Plugins #225
shadowtime2000
started this conversation in
Plugin ideas
Replies: 3 comments 1 reply
|
Possible usage: module.exports = {
injectThis: (config) => {
return {
add: (a, b) => a + b
}
}
}<%= this.add(2, 3) %> |
0 replies
|
I'd really need this as well for e.g. global translation methods 👍🏻 |
0 replies
|
@shadowtime2000 any updates or way one can help out with this? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
Currently there isn't a nice clean way to inject methods or objects with plugins for usage in the template.
Describe the solution you'd like
Some way to inject methods for usage.
Additional context
Carrying over discussion from Gitter, we could allow modification of prototype (I don't think that works), allowing injecting into
thisof template, or use some scoping tricks with dynamic closures to handle this (still thinking about it).All reactions