Skip to content

Provide an API for custom partial resolution #1545

@AndrewLeedham

Description

@AndrewLeedham

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('@', ''));.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions