Npm
npm install art-template --save |
Real-time compilation in browser
download:template-web.js(gzip: 6kb)
compatibility
IE8+(IE8 needs patch for execution. example)
difference
Because browser doesn’t support file system, so template(filename, data)
doesn’t support passing in file paths, and inside the method it uses document.getElementById(filename).innerHTML
to obtain templates. For instance:
<script src="lib/template-web.js"></script> |
Pre-compilation in browser
use loader of webpack: art-template-loader.
Plugins
- Webpack: art-template-loader
- Express: express-art-template
- Koa: koa-art-template