Closed lheinlen closed 6 years ago
@lheinlen Is this still a work in progress?
@unrolled I'm currently using it as implemented in the PR. I was just waiting on your opinion of whether or not this seemed like a feature you would want to include (or whether you preferred a different name for the function, etc.). If it is, I'll write up the tests.
I think subtemplate
would be a good descriptive name (and maybe less confusing). Some tests would be greatly appreciated!
Closing for now, please reopen if needed. Thanks!!
From within a template, I need the ability to render a shared template and specify the binding based on the current context.
For example...
... where
Actions
is a property of eachItem
containing a slice of objects that is used to populate an actions dropdown menu.I added this feature as a new function,
template
. Another option would be to alterpartial
to optionally accept a binding (by adding a...interface{}
parameter). Further,template
may not be best name if a new function is used.Since I was unsure about the most appropriate implementation/naming, I thought I'd go ahead and create a PR and then, if you are interested in this feature, make any modifications and add tests once that is done.
Thank you for the library!