This is an interesting technique that sort of works for me, except for a few (rather important) things:
- server side EJS doesn't recognize canjs's EJS helpers, I am forced to declare
- window.list = can.EJS.Helpers.prototype.list
to get this to work. Come to think of it, I haven't yet checked if the actual live binding works if you do it this way. Is this the right way or do I need to 'include' the helpers some other way?
- how do you get element callbacks to work? My server doesn't know what to do with e.g:
- <div class='item' <%= (el)-> el.data('item', item) %> ></div>
or the classic version
- <div class='item' <%= function(el){ el.data('item', item)} %> ></div>
since this is code that is supposed to be run at runtime of course. How do you do this when precompiling the js?
Thanks,
Michel