RELEASE 2.11.0 OR ABOVE
Returns the APIModels from the current Selection.
Parameters:
Name | Type | Attribute | Description |
---|---|---|---|
options | Object | { skipUndoRedo: false, skipRendering: false } | Set options for APIModel. skipUndoRedo : If this value is true, the result of editing through the model is not undo/redo. Also the old undo/redo stack is initialized. skipRendering : If this value is true, the results of editing through the model are reflected only in the model and not rendered on the screen. After all edits are done, you need to render them separately via editor.render() method. |
Return:
Type | Description |
---|---|
Element[] | Array of API models for editing |
Example:
var paragraph = editor.getAPIModels()[0]; paragraph.append('<span>TEXT</span>');
skipUndoRedo : true
var paragraph = editor.getAPIModels({ skipUndoRedo : true })[0]; paragraph.append('<span>APPEND TEXT</span>');
skipRendering : true
var paragraph = editor.getAPIModels({ skipUndoRedo : true })[0]; paragraph.setText('TEXT'); paragraph.append('<span>APPEND TEXT</span>'); paragraph.prepend('<span>PREPEND TEXT</span>'); editor.render();