Skip to content

Question. Use global functions in interpolation or js mode #257

@jaimegarza

Description

@jaimegarza

I have the need to declare global functions that I want to make available in the curly braces, like this

function md5(str) {
    return "as23sfgo94kl9sde445asdfloremipsumdolor"; // fake of course
}

Then {{md5(it.description)} or {{! md5(it.description)}

I get told that md5 is not defined. This is just a sample of what I am trying to do. Any guidance of how to make globals available, including functions? I know that I can do it as a filter, but I have the need for other things, like {{weekadd(it.someDate, 2)}} etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions