monad98 / ng2-lazy-trumbowyg

Angular 2 Component for lazy loading of Trumbowyg wysiwyg editor
https://plnkr.co/edit/dirpKmLNalUmz0mpdrk7?p=preview
MIT License
12 stars 8 forks source link

Reset trumbowyg #26

Closed HegdeSach closed 6 years ago

HegdeSach commented 6 years ago

Is there any way to reset user input to empty?

monad98 commented 6 years ago

<button (click)="reset()">Reset</button>

reset() {
    this.initialContentOne = "";
}
monad98 commented 6 years ago

Above works only one. I didn't implement reset api. If you want, you can try following

<trumbowyg liveUpdate="true" #editor
               [initialContent]="initialContentTwo"
               [options]="options2"
               (savedContent)="contentTwo=$event">
@ViewChild('editor') editor;
reset() {
    this.editor.trumbowygEl.trumbowyg('empty');
    this.contentTwo = '';
  }