angular-blockly icon indicating copy to clipboard operation
angular-blockly copied to clipboard

generate code

Open rogsmith opened this issue 10 years ago • 2 comments

What is the best way to get the resulting javascript code (not the JSON definitions) from the workspace using angular-blockly?

rogsmith avatar Jan 09 '15 15:01 rogsmith

Did you get an answer ? Did you find out how to do it ? Thanks

aviadlich avatar Jun 25 '15 19:06 aviadlich

This is how it is done for JavaScript Blockly.onChange(function (workspace) { this.Blockly.JavaScript.addReservedWords('code'); var code = this.Blockly.JavaScript.workspaceToCode(workspace); }); }, 0);

aviadlich avatar Jun 27 '15 22:06 aviadlich