【问题标题】:Yeoman placeholder in javascript filesjavascript 文件中的 Yeoman 占位符
【发布时间】:2016-03-23 06:48:03
【问题描述】:

如何将placeholder 中的Yeoman 用于js 文件?我尝试添加它

  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 %>"

任何需要的地方。但这似乎不起作用.. 有什么想法吗?

【问题讨论】:

    标签: yeoman yeoman-generator yeoman-generator-angular


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-02-22
      • 1970-01-01
      • 2012-04-02
      • 2021-04-03
      • 2011-06-28
      • 2020-11-16
      • 2011-12-28
      相关资源
      最近更新 更多