Hello, I’ve been trying to access an ask parameter (interpolation shortcut) from EJS, however I couldn’t yet figure it out where are they stored (if they are). This is inside of the snippet:
protected $[[%ask1:Property Name]];
public function set[[%ask1]]($value)
{
$this-><%= ask1.toLowerCase() %> = $value;
}
If I’m running this I get a Reference Error ask1 is not defined. How can I access ask1 value from within EJS?
EJS converts the embedded JS into code for the macro.
The macro is the run through the interpolator, which handles things
like %(ask).
The macro is then executed.
So this is why the EJS phase doesn’t have access to “ask”.
But, much better, it has access to the whole Mozilla/Komodo API,
including ko.dialogs.prompt, best documented by looking at the header in the actual source
So you can grab a value via ko.dialogs.prompt, or the simpler window.prompt, and use that variable in the macro.