Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customize Froala in angular 2?

Tags:

angular

froala

I have added the Froala editor in my Angular 2 app and it works, I just cant find how to customize the toolbar, to show buttons that I want (bold, italic, underline, etc), any help?

https://github.com/froala/angular2-froala-wysiwyg

like image 330
Nemanja G Avatar asked Jun 13 '17 14:06

Nemanja G


People also ask

Is Froala Editor good?

Froala WYSIWYG HTML Editor is the best rich text editor out there. It is built using the latest technologies and taking the great advantages of jQuery and HTML5 to create an outstanding editing experience.

What is the Froala editor?

Froala Editor is a lightweight WYSIWYG HTML Editor written in Javascript that enables rich text editing capabilities for your applications. Its complete documentation, specially designed framework plugins and tons of examples make it easy to integrate.


1 Answers

You can add option like this:

<div 
    *ngIf="homeIsInEditMode" 
    [froalaEditor]="options" 
    [(ngModel)]="homeMessage.libelleMessage"> 
</div>

And in component add options you want:

public options: Object = {
    placeholderText: 'Edit Your Content Here!',
    charCounterCount: false,
    toolbarButtons: ['bold', 'italic', 'underline', 'paragraphFormat','alert'],
    toolbarButtonsXS: ['bold', 'italic', 'underline', 'paragraphFormat','alert'],
    toolbarButtonsSM: ['bold', 'italic', 'underline', 'paragraphFormat','alert'],
    toolbarButtonsMD: ['bold', 'italic', 'underline', 'paragraphFormat','alert'],
}

You can get more details in the official documentation.

like image 151
Carnaru Valentin Avatar answered Oct 13 '22 03:10

Carnaru Valentin