I am using yeoman-generator, which I need to pass a array of value to the template file. for example I want to pass a array of text values to the template.
install() {
async app() {
let array = ['abc','cde','efg'];
this.fs.copyTpl(
this.templatePath('base','/abc.ts'),
this.destinationPath('example/abc.ts'),
{'array':array}
);
} // app
}// install
in the .ts file, i define a variable which received the passed array.
public options = <%= array %> ;
My expected result is
public options = ['abc','cde','efg'] ;
however the resulted output is
public options = abc,cde,efg ;
how would I resolve this problem ?