0

I'm creating forum and I want the forum to have an area for the user the enter the description, etc similar to what stackoverflow has. Is there's a tool already out there? if not, how can I format selected text in the textarea with angular.

<button (click)="boldSelectedText()">Bold Text</button>

<textarea rows="4" cols="50">
  At w3schools.com you will learn how to make a website. We offer free 
  tutorials in all web development technologies. 
</textarea>

In the picture below is a screenshot of how the one from SO looks like. If you see there a button to bold selected text.

enter image description here

Patricio Vargas
  • 5,236
  • 11
  • 49
  • 100

3 Answers3

4

https://docs.ckeditor.com/ckeditor5/latest/api/ good one for angular or you can google wysiwyg editor for angular

Artyom Amiryan
  • 2,846
  • 1
  • 10
  • 22
1

Use one of the editor libraries for Angular. I would personally recommend ngx-editor. Link: https://sibiraj-s.github.io/ngx-editor/additional-documentation/configuration.html

Sachin Jagtap
  • 423
  • 3
  • 11
0

http://embed.plnkr.co/8F5nG9FJ6ZsuCtH8zrmH the exactly name is WYSWYG, try with ng-style or ng-class.

  • Any code necessary to make sense of the answer should be included as part of the answer. Please [edit](https://stackoverflow.com/posts/52878518/edit) your answer and include any relevant code there. – Ruzihm Oct 18 '18 at 17:24
  • You answer works. Yes, you are right that's how it's called, but your solution is using AngularJS not Angular. – Patricio Vargas Oct 18 '18 at 19:10