You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Def functions are invoked right away.
If you want to use def functions and pass values from your it data you can do:
option 1 :
{{##def.mytestparam: {{=it.name}} #}}
{{#def.test(def.mytestparam)}}
option 2:
{{#def.test("{{=it.name}}")}}
You can also use parameterized def instead of a function in this case like this:
{{##def.test:myparam:
My name is: {{=myparam}}
#}}
I can't get it working.
Option 1 has and unexpected behaviour: The string "{{=it.name}}" not evaluated is passed to test function.
Option 2 gives me: "Unexpected token ILLEGAL".
I can see now where is my problem.
First, it can't be defined inside another {{##def.block}}
Then, I was trying to evaluate nested def functions like this.
Activity
olado commentedon Jan 12, 2015
Def functions are invoked right away.
If you want to use def functions and pass values from your it data you can do:
option 1 :
{{##def.mytestparam: {{=it.name}} #}}
{{#def.test(def.mytestparam)}}
option 2:
{{#def.test("{{=it.name}}")}}
You can also use parameterized def instead of a function in this case like this:
{{##def.test:myparam:
My name is: {{=myparam}}
#}}
{{#def.test:it.name}}
maxiruani commentedon Jan 13, 2015
I can't get it working.
Option 1 has and unexpected behaviour: The string "{{=it.name}}" not evaluated is passed to test function.
Option 2 gives me: "Unexpected token ILLEGAL".
There is another option?
added example for issue #137
olado commentedon Jan 13, 2015
@maxiruani @ogrape I added an example here 195025f
You can pull this and run node withdoT.js to see that all 3 options work.
maxiruani commentedon Jan 13, 2015
I can see now where is my problem.
First, it can't be defined inside another {{##def.block}}
Then, I was trying to evaluate nested def functions like this.
The string "{{=it.jobsCount}}" is passed to functionTwo instead of the evaluated string.
This works
This doesn't
Any ideas?
Thanks a lot!