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) %> |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'd really need this as well for e.g. global translation methods 👍🏻 |
Beta Was this translation helpful? Give feedback.
0 replies
-
@shadowtime2000 any updates or way one can help out with this? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
this
of template, or use some scoping tricks with dynamic closures to handle this (still thinking about it).Beta Was this translation helpful? Give feedback.
All reactions