sachinchoolur / angular-trix

A rich WYSIWYG text editor directive for angularjs.
http://sachinchoolur.github.io/angular-trix/
MIT License
328 stars 62 forks source link

how to retrieve html string from editor #35

Open barb12 opened 7 years ago

barb12 commented 7 years ago

to retrieve the text from the trix-editor the following is used $scope.trixInitialize = function(e, editor) { editor.getDocument() // is a Trix.Document instance } this returns the string of editor's content... i would like to know to return the html string content of the editor thanks

Mowso commented 7 years ago

I guess you can't retrieve the html content of the editor with a trixInitialize function. I am not quite sure I'm understanding your issue but if you want to get the text that you're typing in the editor appears, you might want to use a change or a blur event like : trix-change or trix-blur

Saikat-Sinha commented 7 years ago

@barb12 to retrive trix HTML strings you can use editor.element.innerHTML or on trix-change event changeEvent.target.value

philiplambok commented 5 years ago

Thank you @Saikat-Sinha !