Markup.js icon indicating copy to clipboard operation
Markup.js copied to clipboard

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

Open csetea opened this issue 11 years ago • 2 comments

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!

csetea avatar May 14 '14 16:05 csetea

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 ...

csetea avatar May 15 '14 09:05 csetea

Thanks for this! I'll check out ASAP.

adammark avatar May 15 '14 20:05 adammark