Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Rich Text editor AngularJS

I know there are lots of great rich text editors out there that can easily be ported to angular and plenty of discussion on how to do this, but I'd like to create my own.

I have the basic idea down:

  • create a text area and watch the input and perform a function as the input changes. I am familiar with the ngBindhtml directive, only to the extent that I can apply it to an element.

Any idea how I might be able to create a function that would render plain text into html?

like image 359
richbai90 Avatar asked Apr 26 '13 02:04

richbai90


1 Answers

I've tried it before but ended up using textAngular.

Basically i replaced the textarea with a iframe, similar to the way tinyMCE does.

The contenteditable on a element allow you to replace the textarea and write directly on the div. You would insert all html elements like headers and text this way. You'll have to handle the cursor position on text, apply styles based on buttons and text selection, etc.

like image 182
Gui Avatar answered Sep 26 '22 05:09

Gui