Wysiwyg documentation


Topic: Wysiwyg documentation

Dave Moniz premium priority asked 9 months 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 9 months 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
  • User: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: MDB5 1.3.0
  • Device: PC
  • Browser: Google Chrome
  • OS: Arch Linux
  • Provided sample code: No
  • Provided link: No