tolquito
tolquito

Reputation: 91

Yeoman placeholder in javascript files

How can I use a placeholder in Yeoman for a js file ? i tried to add it

  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
      }
      );
    }
  },

and in the js File just added

"<%= title %>"

wherever needed. But it doesn't seems to work.. Any ideas ?

Upvotes: 0

Views: 251

Answers (1)

Simon Boudrias
Simon Boudrias

Reputation: 44609

You need to use this.fs.copyTpl() otherwise the template tags are not processed.

Upvotes: 1

Related Questions