Angular 9+ bindings for Froala WYSIWYG Editor. See Demo
You can install ngx-froala by using npm.
npm install ngx-froala froala-editor --save
Open angular.json
file
- insert a new entry into the
styles
array
"styles": [
"node_modules/froala-editor/css/froala_editor.pkgd.css",
"..."
],
- insert a new entry into the
scripts
array
"scripts": [
"node_modules/froala-editor/js/froala_editor.pkgd.min.js",
"..."
],
Import ngx-froala
module
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { NgxFroalaModule } from 'ngx-froala'; // <-- add
@NgModule({
imports: [
BrowserModule,
NgxFroalaModule // <-- add
],
declarations: [
AppComponent,
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Then in HTML
<div froalaEditor [options]="options" [(ngModel)]="text"></div>
[options]
- type:
FroalaOptions
- require:
false
- description: option for froala editor. see document
[oncreated]
- return: Froala instance
- description: trigger when created the froala editor
<ngx-froala-view [text]="text"></ngx-froala-view>
[text]
- type:
string
- require:
true
This project is licensed under the MIT License - see the LICENSE file for details