更改 style/format 所选文本 - Angular
Change style/format of selected text - Angular
我正在创建论坛,我希望论坛有一个区域供用户输入描述等,类似于 Whosebug 的功能。那里已经有工具了吗?如果没有,我如何使用 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>
下图是来自SO的截图。如果您看到有一个按钮可以将选定的文本加粗。
https://docs.ckeditor.com/ckeditor5/latest/api/
angular 不错,你也可以 google wysiwyg editor for angular
http://embed.plnkr.co/8F5nG9FJ6ZsuCtH8zrmH 准确的名字是 WYSWYG,试试 ng-style 或 ng-class.
使用 Angular 的编辑器库之一。我个人会推荐 ngx-editor。
Link: https://sibiraj-s.github.io/ngx-editor/additional-documentation/configuration.html
我正在创建论坛,我希望论坛有一个区域供用户输入描述等,类似于 Whosebug 的功能。那里已经有工具了吗?如果没有,我如何使用 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>
下图是来自SO的截图。如果您看到有一个按钮可以将选定的文本加粗。
https://docs.ckeditor.com/ckeditor5/latest/api/
angular 不错,你也可以 google wysiwyg editor for angular
http://embed.plnkr.co/8F5nG9FJ6ZsuCtH8zrmH 准确的名字是 WYSWYG,试试 ng-style 或 ng-class.
使用 Angular 的编辑器库之一。我个人会推荐 ngx-editor。 Link: https://sibiraj-s.github.io/ngx-editor/additional-documentation/configuration.html