I thought I saw in http://www.infoq.com/presentations/CanJS that we can bind "both way" from an input text box in a view, to and from a can.Observe ?
But somehow the following won't work:
- <script type='text/ejs' id='template'>
- <input type="text" value="<%= foo.attr('bar') %>">
- </script>
- <script>
- var foo = new can.Observe({ bar: "hello" });
- var template = can.view("#template", {
- foo: foo
- });
- $(document.body).prepend(template);
- </script>