yeoman print code character in templates
Asked Answered
G

1

5

when i copy a template with this.copyTpl yeoman print code cacharter of quotes and not quotes ...here what im doing in index.js

this.dependencies["fontawesome"] = "4.2";
this.dependencies["jQuery"] = "~1.11.1";
this.dependencies["responsive-nav"] = "1.0.34";
this.dependencies["superfish"] = "1.7.5";

this.dep = JSON.stringify(this.dependencies); 

console.log(this.dep)
display 
{"fontawesome":"4.2","jQuery":"~1.11.1","responsive-nav":"1.0.34","superfish":"1.7.5"}

 this.fs.copyTpl(
            this.templatePath('_bower.json'),
            this.destinationPath(projectPath +'/bower.json'),{
                projectName: _.slugify(this.project_name),
                dependencies: this.dep
            }
        );

result file

{"fontawesome":"4.2","jQuery":"~1.11.1","responsive-nav":"1.0.34","superfish":"1.7.5"},

why this occurs, i need extra config where?? what i missing ?? thanks for help

Goober answered 9/5, 2016 at 1:37 Comment(0)
I
11

<%= escape values passed to it to prevent XSS.

To output raw input you need to use the <%- template tags.

Full documentation on the template engine used by Yeoman at http://ejs.co/

Ignitron answered 9/5, 2016 at 6:4 Comment(1)
@PabloEnanoskiAraya If that answered your question, you can set this answer as accepted by clicking the check mark next to my answer.Ignitron

© 2022 - 2024 — McMap. All rights reserved.