Ideally I'd like to be able to have an template which can be evaluated either on the server or on the client side without too much hassle switching over.
Both these solutions don't use a common template file which is directly evaluated in JS or Java. The template must first be compiled into an intermediate JS before evaluation on the client. (For Closure, this is fairly easy to do with
ant and an included
SoyToJsSrcCompiler.jar command line tool. Not sure about with Casper.)
EDIT: Another possibility is Mustache, which does not require templates to be compiled.
©2020 All rights reserved.