Closed JPPreusDev closed 4 years ago
var editor = grapesjs.init({
// ...
});
console.log(editor.Commands.get('gjs-get-inlined-html'));
That works. My concern now is how I actually get the HTML. This returns an object.
Worked it out:
var editor = grapesjs.init({
// ...
});
console.log(editor.Commands.get('gjs-get-inlined-html').run(editor));
You can also do like this:
var editor = grapesjs.init({
// ...
});
console.log(editor.runCommand('gjs-get-inlined-html'));
It's returning undefined
for me. Any idea why?
Also, editor.Commands.has('gjs-get-inlined-html')
returns false
.
grapesjs 0.14.27
grapesjs-preset-newsletter 0.2.19
I'm getting undefined as well, any update on this?
getting undefined as well any reasons ?
Same here
editor.runCommand('gjs-get-inlined-html')
works in the demo (you can try it in dev console). Be sure to use the latest version
Hello @artf
I have the same issue but only at the initialization after the command work fine.
/! grapesjs - 0.16.12 / /! grapesjs-preset-newsletter - 0.2.20 /
editor = grapesjs.init({
container: '#gjs',
plugins: ['gjs-preset-newsletter'],
pluginsOpts: {
'gjs-preset-newsletter': {
}
},
});
// Doesn't work
editor.runCommand('gjs-get-inlined-html')
editor.on('change:changesCount', e => {
// Work after first edition
editor.runCommand('gjs-get-inlined-html')
});
Thanks :)
Please help me figure out how to call the gjs-get-inlined-html command.