Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Wysiwyg documentation

Dave Moniz priority asked 3 years ago


Is there a method similar to getCode() that instead of getting the value of the wysiwyg, it sets it. For example setCode().

This would be useful for a form reset. I need to know how to programmatically empty the wysiwyg.

Also there's some issues with the documentation for the wysiwyg:

There are many methods/attributes available in the MdbWysiwygComponent that are completely missing from the documentation.

Code below is taken from the docs - "currentValue" below is undefined

import { Component, ViewChild } from '@angular/core';
import { MdbWysiwygComponent } from 'mdb-angular-wysiwyg';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
})
export class AppComponent {
  @ViewChild('wysiwyg') wysiwyg: MdbWysiwygComponent;

  getValue() {
    console.log(this.currentValue);
  }
}

Arkadiusz Idzikowski staff answered 3 years ago


@Dave Moniz The WYSIWYG component works like a custom Angular form control, you can use formControl/ngModel methods in order to set/get the editor value (just like in regular input element).

Thank you for pointing out errors in the documentation, we will fix that and add more examples for form controls.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: MDB5 1.3.0
  • Device: PC
  • Browser: Google Chrome
  • OS: Arch Linux
  • Provided sample code: Yes
  • Provided link: No