diff --git a/index.js b/index.js index bdf923b..a14cabf 100644 --- a/index.js +++ b/index.js @@ -25,7 +25,8 @@ var defaults = { wrapFooter: null, indent: '', template: undefined, - templatePath: TEMPLATE_PATH + templatePath: TEMPLATE_PATH, + comment: '' }; function ngConstantPlugin(opts) { @@ -56,7 +57,8 @@ function ngConstantPlugin(opts) { moduleName: getModuleName(data, options, file), deps: getModuleDeps(data, options), constants: getConstants(data, options), - indent: options.indent + indent: options.indent, + comment: "/* " + options.comment + " */\n" }); // Handle wrapping diff --git a/tpls/constant.tpl.ejs b/tpls/constant.tpl.ejs index 164108d..e785be2 100644 --- a/tpls/constant.tpl.ejs +++ b/tpls/constant.tpl.ejs @@ -1,2 +1,3 @@ +<%= comment %> angular.module("<%- moduleName %>"<% if (deps) { %>, ${JSON.stringify(deps)}<% } %>) <% constants.forEach(function(constant) { %>${indent}.constant("<%- constant.name %>", ${constant.value})<%= _.last(constants) === constant ? '' : '\n' %><% }) %>;