import { Component , forwardRef } from '@angular/core' ; import { ControlValueAccessor , NG_VALUE_ACCESSOR } from "@angular/forms" ; @ Component ( { selector : 'froala-component' , template : `
    <textarea [froalaEditor]="config" (froalaModelChange)="onChange($event)" [(froalaModel)]="model"></textarea>
   ` , providers : [ { provide : NG_VALUE_ACCESSOR , useExisting : forwardRef ( ( ) => FroalaComponent ) , multi : true } ] } ) export class FroalaComponent implements ControlValueAccessor { constructor ( ) { } onChange = ( _ ) => { } ; onTouched = ( ) => { } ; writeValue ( content ) { this . model = content ; } registerOnChange ( fn ) { this . onChange = fn ; } registerOnTouched ( fn ) { this . onTouched = fn ; } model : any ; config : Object = { charCounterCount : false } ; }