项目作者: boatzako

项目描述 :
Angular 9+ plugin for Froala Editor
高级语言: TypeScript
项目地址: git://github.com/boatzako/ngx-froala.git
创建时间: 2019-07-21T13:52:17Z
项目社区:https://github.com/boatzako/ngx-froala

开源协议:MIT License

下载


ngx-froala

dependencies Status
devDependencies Status

Angular 9+ bindings for Froala WYSIWYG Editor.
See Demo

Getting Started

You can install ngx-froala by using npm.

  1. npm install ngx-froala froala-editor --save

Add Froala editor to angular app

Open angular.json file

  • insert a new entry into the styles array
    1. "styles": [
    2. "node_modules/froala-editor/css/froala_editor.pkgd.css",
    3. "..."
    4. ],
  • insert a new entry into the scripts array
    1. "scripts": [
    2. "node_modules/froala-editor/js/froala_editor.pkgd.min.js",
    3. "..."
    4. ],

Usage

Import ngx-froala module

  1. import { NgModule } from '@angular/core';
  2. import { BrowserModule } from '@angular/platform-browser';
  3. import { AppComponent } from './app.component';
  4. import { NgxFroalaModule } from 'ngx-froala'; // <-- add
  5. @NgModule({
  6. imports: [
  7. BrowserModule,
  8. NgxFroalaModule // <-- add
  9. ],
  10. declarations: [
  11. AppComponent,
  12. ],
  13. bootstrap: [ AppComponent ]
  14. })
  15. export class AppModule { }

Then in HTML

  1. <div froalaEditor [options]="options" [(ngModel)]="text"></div>

Froala editor directive

Input

[options]

  • type: FroalaOptions
  • require: false
  • description: option for froala editor. see document

Output

[oncreated]

  • return: Froala instance
  • description: trigger when created the froala editor

Froala view

  1. <ngx-froala-view [text]="text"></ngx-froala-view>

Input

[text]

  • type: string
  • require: true

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details