2016-03-22 41 views
0

如何在Yeoman中使用placeholder作为js文件?我试图将它添加在JavaScript文件中的Yeoman占位符

writing: function() { 
    this.fs.copy(
     this.templatePath('portanova_template'), 
     this.destinationPath(this.projectName) 

    ); 
    if(this.answer) { 
     this.fs.copy(
     this.templatePath('externalTemplate'), 
     this.destinationPath(this.projectName+'/app'), 
     { 
     title: this.projectName 
     } 
    ); 
    } 
    }, 

和JS文件只是添加

"<%= title %>" 

需要的地方。但它似乎并没有工作.. 任何想法?

回答

1

您需要使用this.fs.copyTpl()否则将不处理模板标签。