我正在构建一个没有 grunt 或 glup 的构建过程,并且希望需要 ngtemplate,因为团队使用它,但找不到它的独立包,但我愿意在新系统中制作一个,只需要在正确的方向。
最佳答案
您可以编写一个简单的 js 脚本,迭代除 node_modules 或 bower_components 之外的所有目录,并读取扩展名为 .html 的文件并将内容附加到文件>templates.js 你的 templates.js 可能看起来像这样
angular.module('templates').run(['$templateCache',
function($templateCache) {
$templateCache.put('filename1','filecontent1');
$templateCache.put('filename2','filecontent2');
}]);
关于javascript - 没有 grunt 或 gulp 的 Ng 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45625791/