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

example code for insertImage

Open emptyway opened this issue 9 years ago • 6 comments

this used to work to get the editor

var editor = $.summernote.eventHandler.getModule(); 

But after update summer note to version 0.7.1 its broken.

The correct way to get the editor object, I got the object but can't use this functions with it insertImage(editable, url)

Thanks!

emptyway avatar Feb 10 '16 17:02 emptyway

try this instead

$scope.editor.summernote('editor.insertImage', url);

MasterMarandu avatar Feb 11 '16 14:02 MasterMarandu

Did you see https://github.com/summernote/angular-summernote#event-listeners?

outsideris avatar Feb 13 '16 12:02 outsideris

@Cabeza thanks! its working fine now!

@outsideris Yes, I did. But didn't know how to implement it. I inspected the $scope.editor object and indeed the editor was there, but couldn't find a way to call insertImage.

Would be nice if there is an example code in the documentation. I searched on Google & SO and saw many wrong answers around.

emptyway avatar Feb 15 '16 13:02 emptyway

@simonlinj I got it.

outsideris avatar Feb 19 '16 11:02 outsideris

@Cabeza many thanks

vimphen avatar Oct 13 '16 13:10 vimphen

@Cabeza i love, it work for me, after many hours searching a example

davidCanche1994 avatar Sep 14 '18 16:09 davidCanche1994