template-lint icon indicating copy to clipboard operation
template-lint copied to clipboard

Support Value Converters

Open MeirionHughes opened this issue 8 years ago • 4 comments

Upon finding a converter:

${some.value | booBoo}

should do the following:

  • reverse naming convention: booBoo > BooBooValueConverter
  • look for {caller-base-path}\boo-boo.ts
    • fallback: look for any module that exports BooBooValueConverter
  • if source found
    • find toView method
    • if toView Model has a static type output:
      • use that type as contect and continue access chain.

MeirionHughes avatar Jul 01 '16 09:07 MeirionHughes

Note, value converters can be registered globally as well.

atsu85 avatar Jul 01 '16 19:07 atsu85

...And imported using require tag.

atsu85 avatar Jul 01 '16 19:07 atsu85

yeah, this is where things start to get a little difficult --without actually loading up aurelia fully-- to be honest :D

MeirionHughes avatar Jul 01 '16 20:07 MeirionHughes

Yeah, that might be a problem with global VCs, but not with require tags

atsu85 avatar Jul 01 '16 22:07 atsu85