angular-froala-wysiwyg icon indicating copy to clipboard operation
angular-froala-wysiwyg copied to clipboard

v3 is not working with ngModel

Open abdulkareemnalband opened this issue 5 years ago • 9 comments

in v3 froala editor is not working with ngModel but works fine with froalaModel.

froala version

Environment

@angular-devkit/architect         0.10.7
@angular-devkit/build-angular     0.10.7
@angular-devkit/build-optimizer   0.10.7
@angular-devkit/build-webpack     0.10.7
@angular-devkit/core              7.0.7
@angular-devkit/schematics        7.0.7
@angular/cli                      7.0.7
@angular/compiler-cli             7.0.4
@angular/language-service         7.0.4
@ngtools/webpack                  7.0.7
@schematics/angular               7.0.7
@schematics/update                0.10.7
rxjs                              6.5.2
typescript                        3.1.6
webpack                           4.19.1

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Repro Steps

see this repo

image

abdulkareemnalband avatar Aug 20 '19 14:08 abdulkareemnalband

i got same problem. Also [(froalaModel)]="content" not works.

It only works with [froalaModel]="content" (fraolaModelChange)="content = $event"

leo6104 avatar Aug 20 '19 16:08 leo6104

This may be due to specific pages that use the same settings for multiple froala editors.

JCanlett avatar Oct 16 '19 17:10 JCanlett

related ? #318

JCanlett avatar Oct 16 '19 17:10 JCanlett

As per version 3.1.0 still not working code is available here https://gitlab.com/abdulkareemnalband/angular-froala-ngmodel-issue

image

abdulkareemnalband avatar Jan 30 '20 07:01 abdulkareemnalband

Acording to our docs you should use ngmodel like this:

<div [froalaEditor] [(froalaModel)]="ngModel"></div>
<input [(ngModel)]="ngModel" />

https://stackblitz.com/edit/github-m7wmdb?file=demo%2Fsrc%2Fapp%2Ffroala.component.ts

dejanmartinovic avatar Feb 04 '20 22:02 dejanmartinovic

Hi @dejanmartinovic as froalaEditor provides NG_VALUE_ACCESSOR (here) , we should be able to use ngModel or formControl directives without any issue

abdulkareemnalband avatar Feb 07 '20 05:02 abdulkareemnalband

ngModel not working with textarea <textarea (froalaModelChange)="comment = $event" [froalaEditor]="froalaOptions" [(ngModel)]="comment"></textarea>

froalaModelChange also not working <textarea (froalaModelChange)="comment = $event" [froalaEditor]="froalaOptions" [froalaModel]="comment" name="comment"></textarea>

I am using angular-froala-wysiwyg - v3.1.1 with Angular 9

poddarkhushbu07 avatar May 10 '20 10:05 poddarkhushbu07

I can confirm the issue with 3.1.1 & 3.2.0. Do you want me to fill a customer ticket ?

qdelettre avatar Jul 27 '20 11:07 qdelettre

@qdelettre please do, we did when I opened this ticket, still no solution

abdulkareemnalband avatar Jul 27 '20 15:07 abdulkareemnalband