Updated dot_core for backwards compatibility so that the examples can work,,,#4
Updated dot_core for backwards compatibility so that the examples can work,,,#4NathanaelA wants to merge 1 commit intoprintercu:masterfrom
Conversation
… work. Updated browsersampel example to point to non-minified dot.js file Updated README.md to have instructions on how to build the client side dot.js
|
Hi! Thanks for PR. Sorry for poor documentation - I haven't updated it since major version update. But I think it'll be better to write npm task to compile browser version. Indeed I had no one yet 'cause i use nrockets (similar to sprockets) to concat & compile it into js. About compatibility with original doT. I knew about that incompatibilities and so I incremented major version number. However one can add old behaviour with # dot_custom.coffee
# ...
dot = new DotCore settings
dot.template = (tmpl, compileParams = {}) ->
# Compatibility with original dot.template command(templ,,def)
if arguments.length == 3 && arguments[2]?
compileParams.def = arguments[2]
@compile tmpl, compileParams |
|
Not a problem -- I do like the way you separated out the tags in your rewrite of the dot. You can do it either your way (make a new template command that has the logic before it calls compile) or my way (link the prototype, and add two lines of code to compile). It would help people to use your version, if it was backwards compatible with the original version and all the original versions examples... |
Updated browsersample example to point to non-minified dot.js file
Updated README.md to have instructions on how to build the client side dot.js