[Templates] Add parameter names for required templates

This commit is contained in:
Victor Woeltjen 2016-02-26 12:51:58 -08:00
parent f2e4b01721
commit 852faf061e

View File

@ -52,12 +52,18 @@ function injectRequireArgument(sourceCode, templateUrls) {
templateUrls = _.uniq(templateUrls);
// Add arguments for source paths...
index = lines.map(_.trim).indexOf("'legacyRegistry'");
lines = lines.slice(0, index).concat(templateUrls.map(function (url) {
return " \"text!./res/" + url + "\",";
}).concat(lines.slice(index)));
/// ...and for arguments
index = lines.map(_.trim).indexOf("legacyRegistry");
lines = lines.slice(0, index).concat(templateUrls.map(function (url) {
return " " + toTemplateName(url) + ",";
}).concat(lines.slice(index)));
return lines.join('\n');
}