Angularjs template grunt-angular-templates 生成的缓存路径
Angularjs template grunt-angular-templates generated cache path
我的文件结构是这样的
- 来源
- 应用程序
- 门票
- template.html
- index.html
- app.min.js
我正在使用 grunt-angular-templates 创建缓存。我的配置是这样的
ngtemplates:{
app:{
src: 'src/app/**/*.html',
dest: 'src/templates.js',
htmlmin: {
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true
}
}
}
Bu 这会生成这样的模板:
$templateCache.put('src/app/ticket/template.html', '.......');
但应该是$templateCache.put('app/ticket/template.html', '.......');
我可以通过配置更改路径吗?
它可能会通过指定 cwd 来工作:
ngtemplates:{
app:{
cwd: 'src/',
src: 'app/**/*.html',
dest: 'templates.js',
htmlmin: {
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true
}
}
}
我的文件结构是这样的
- 来源
- 应用程序
- 门票
- template.html
- index.html
- app.min.js
我正在使用 grunt-angular-templates 创建缓存。我的配置是这样的
ngtemplates:{
app:{
src: 'src/app/**/*.html',
dest: 'src/templates.js',
htmlmin: {
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true
}
}
}
Bu 这会生成这样的模板:
$templateCache.put('src/app/ticket/template.html', '.......');
但应该是$templateCache.put('app/ticket/template.html', '.......');
我可以通过配置更改路径吗?
它可能会通过指定 cwd 来工作:
ngtemplates:{
app:{
cwd: 'src/',
src: 'app/**/*.html',
dest: 'templates.js',
htmlmin: {
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true
}
}
}