aurelia / templating-binding

An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.
MIT License
32 stars 26 forks source link

one-time interpolation binding expressions #24

Closed jdanyow closed 9 years ago

jdanyow commented 9 years ago

supported in next release

schatekar commented 8 years ago

@jdanyow Is this feature released? Apologies for a dumb question but I tried following your commit and got lost. I need to know if the following will work?

<input type="text" data-original="${name | oneTime}" value.bind="name" />

I specifically interested in the | oneTime part.

jdanyow commented 8 years ago

yep, the symbol for binding behaviors is & (as opposed to | for value converters).

<input type="text" data-original="${name & oneTime}" value.bind="name" />

Here's the standard way to write a one-time binding. This will be a bit more light-weight in terms of parsing and binding:

<input type="text" data-original.one-time="name" value.bind="name" />