WYSIWYG editor - unable to set initial value (no @inputs pre


Topic: WYSIWYG editor - unable to set initial value (no @inputs present)

japan pro asked 6 days ago

Expected behavior I need the wysiwyg to enable setting initial value. This is needed for enabling of editing existing values (i.e. loaded from server) within forms.

Actual behavior Unable to set the value. No documentation around this feature in here: https://mdbootstrap.com/plugins/angular/wysiwyg/

Is it on your development roadmap or is there this feature and I just missed it?


JeroenVunderink pro answered 5 days ago

Hi,

I use a form group:

ngOnInit(): void {
    this.frm = new FormGroup({
        remarks: new FormControl('', [Validators.required]),
    });
    RetrieveData();
}

Then I retrieve the data in RetrieveData and within the the restCall I set the value.

 this.frm.controls.remarks.setValue(this.data.Remarks);

Hope this helps.


japan pro commented 4 days ago

Hi, thanks, you're right, the easiest solution is the best, this works ! Cheers !


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: Angular
  • MDB Version: 10.0.0
  • Device: any device
  • Browser: all browsers
  • OS: any os
  • Provided sample code: No
  • Provided link: Yes