Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an API for custom partial resolution #1545

Open
AndrewLeedham opened this issue Sep 1, 2019 · 1 comment
Open

Provide an API for custom partial resolution #1545

AndrewLeedham opened this issue Sep 1, 2019 · 1 comment
Labels
Milestone

Comments

@AndrewLeedham
Copy link
Contributor

Currently in order to implement custom partial resolution, you need to override the function Handlebars.VM.resolvePartial. This seems a bit hacky so perhaps there should be a top-level API to support this.

An example of the current solution:
https://jsfiddle.net/AndrewLeedham/91dacogf/4/

Perhaps the new API could be implemented using the register pattern helpers and partials. So a consumer could provide a function that takes a name and returns a modified version. Perhaps: Handlebars.registerNameResolution((name) => name.replace('@', ''));.

@AndrewLeedham AndrewLeedham mentioned this issue Sep 1, 2019
8 tasks
@nknapp nknapp added the feature label Sep 20, 2019
@nknapp
Copy link
Collaborator

nknapp commented Apr 5, 2020

Looks like this is another case for defining a generic "hooks" api, like in #1435

@nknapp nknapp added this to the Backlog milestone Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants