Passing an array of Strings from Groovy to Javascript -


i building array of strings in groovy code , want pass array javascript script contained in code. however, groovy doesn't put strings in array quotes javascript expects. i'm passing array using gstrings:

var strains = ${strainnames}; 

javascript evaluates this:

var strains = [pseudomonas_aeruginosa_d421, pseudomonas_aeruginosa_oc2e, pseudomonas_aeruginosa_ea0a, pseudomonas_aeruginosa_0812]; 

is there way add quotes each element or have add them in groovy code?

you change:

var strains = ${strainnames}; 

to

var strains = ${strainnames.inspect()}; 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

unity3d - Fatal error- Monodevelop-Unity failed to start -