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

Added support for template converters #120

Merged
merged 3 commits into from
Aug 12, 2019
Merged

Conversation

nmetulev
Copy link
Contributor

PR Type

  • Feature

Description of the changes

This PR adds support for converters in our templates. Ex:

<mgt-agenda id="myDay">
    <template data-type="event">
        <div>
            <div>{{ event.subject }}</div> <!-- this replaces event.subject with value -->
            <div>{{{ myConverter(event.subject }}}</div> <!-- this evaluates the expression -->
        </div>
    </template>
</mgt-agenda>

<script>
    let agenda = document.getElementById('myDay');
    agenda.templateConverters.myConverter = str => str.toUpperCase();
</script>

PR checklist

  • Added tests and all passed
  • All public classes and methods have been documented
  • Added appropriate documentation
  • License header has been added to all new source files
  • Contains NO breaking changes

Other information

@nmetulev nmetulev merged commit 1f6b62c into master Aug 12, 2019
@nmetulev nmetulev deleted the nmetulev/templateConverters branch August 12, 2019 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants