The following recipes show how to use can.EJS's live binding.
Updating timestamps
The following shows how to create an automatically updating prettyDate
helper for EJS that can be used like:
<%= prettyDate( new Date() ) %>
Notice how the created value changes every couple min or
so.
The prettyDate method works with or without live-binding. It doesn't need to take
an observe, just a date. Code with EJS becomes live naturally ... amazing.
2-way binding Mustache helpers
Learn how to make 2-way binding mustache helpers. When you change the value of an input, it automatically
changes the value of an observe. When you change the value of the observe, it changes the value of the
input.
The following recipes show how to use
can.EJS
's live binding.Updating timestamps
The following shows how to create an automatically updating
prettyDate
helper for EJS that can be used like:Notice how the created value changes every couple min or so.
The
prettyDate
method works with or without live-binding. It doesn't need to take an observe, just a date. Code with EJS becomes live naturally ... amazing.2-way binding Mustache helpers
Learn how to make 2-way binding mustache helpers. When you change the value of an input, it automatically changes the value of an observe. When you change the value of the observe, it changes the value of the input.
How it works