Yeoman で ember アプリを作成すると、ハンドルバー テンプレート フォルダー (.hbs) が作成されます。
Yeoman の設定は次のように設定されています。
watch: {
ember_templates: {
files: '<%= yeoman.app %>/templates/**/*.hbs',
tasks: ['ember_templates', 'livereload']
},
- テンプレートがフォルダーのルートにある場合、それは機能します
- テンプレートがサブフォルダーにある場合、テンプレートは
template/mySubfolder
レンダリングされません (html は返されません)。 - テンプレートが見つからない場合、ember はエラーをスローします
したがって、テンプレートがサブフォルダーにある場合は、ある程度検出されます...しかし、レンダリングされないのはなぜですか
いろいろ表現してみましたGruntfile.js
が改善されませんでした。
watch: {
ember_templates: {
files: '<%= yeoman.app %>/templates/{,*/}*.hbs',
tasks: ['ember_templates', 'livereload']
},
@Mishik (コメントには長すぎます)
「時計」部分全体:
watch: {
ember_templates: {
files: '<%= yeoman.app %>/templates/**/*.hbs',
tasks: ['ember_templates', 'livereload']
},
coffee: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
tasks: ['coffee:dist']
},
coffeeTest: {
files: ['test/spec/{,*/}*.coffee'],
tasks: ['coffee:test']
},
compass: {
files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
tasks: ['compass:server']
},
neuter: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
tasks: ['neuter', 'livereload']
},
livereload: {
files: [
'<%= yeoman.app %>/*.html',
'{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
],
tasks: ['livereload']
}
}
そして、私が初めて見たものではありません:
ember_templates: {
options: {
templateName: function (sourceFile) {
var templatePath = yeomanConfig.app + '/templates/';
return sourceFile.replace(templatePath, '');
}
},
dist: {
files: {
'.tmp/scripts/compiled-templates.js': '<%= yeoman.app %>/templates/{,*/}*.hbs'
}
}
}
それは私が修正する必要がある部分ですか?私はいくつかのことを試しましたが、うまくいきませんでした。