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

Customization options: undefinedResult provider '???', pipeNotFound handler #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

csetea
Copy link

@csetea csetea commented May 14, 2014

It is confusing to become '???' as default result if value not found in context.
My use case scenario is the next:
I process templates in more steps to generate UI and documents e.g.:

  • preprocessing:
    1. include other templates
    2. replace message placeholders (i18n)
    3. cache the preprocessed tempalte
  • fill with model values
    • fill the templates with model values

PS: Mark.up rocks!

Customization improvement, +2 function:
 undefinedResult(tag) - default implementation returns '???' characters
 pipeNotFound(pipeName, e) - called if pipe not found, by default writes on console.warn
@csetea
Copy link
Author

csetea commented May 15, 2014

i have forgotten to describe the advantage in details - but it is evident.
The default undefinedResult implementation returns with ??? as otherwise would happen.

In my scenario i assign an implementation that returns with the original 'tag' which not breaks the templating in more steps.

Examples for another customization use cases:

  • logging expressions that are not found in context
  • default value resolving depending on context and expression
  • fire event ...

@adammark
Copy link
Owner

Thanks for this! I'll check out ASAP.

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.

None yet

2 participants