A commonJS module provides function to compile angular templates written in jade-lang into a JS file. It utilizes $templateCache. The jade files must end with .tpl.pug
or .tpl.jade
as file extension.
Please note this compiler runs synchronously.
This module depends on node-ls. Please run npm install
.
It is possible to use npm
to install this repo. Simply adds the URL to the package.json
and run npm install
.
var compiler = require('node-angular-template-compiler');
var angularJSModuleName = 'Template'; // defines angularJS module name
var configs = {}; // defines jade options
var srcFolderPath = '/path/to/template/folder/'; // defines path to folder contains jade files. Files must end with .tpl.jade
var distFilePath = '/path/to/dist/Template.js'; // defines path of the created angular module
// creates an angularJS module named Template stored as /path/to/dist/Template.js
compiler.compiler(angularJSModuleName,
configs,
srcFolderPath,
distFilePath);