jQuery UI Widgets Forums General Discussions I’d appreciate any advice about: Editor.

This topic contains 1 reply, has 2 voices, and was last updated by  admin 10 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • sande
    Participant

    How can I listen for content change events in jqxEditor and react accordingly in Angular?


    admin
    Keymaster

    Hi sande,

    import { Component, ViewChild, AfterViewInit } from '@angular/core';
    import { jqxEditorModule, jqxEditorComponent } from 'jqwidgets-ng/jqxeditor';
    
    @Component({
      selector: 'app-root',
      imports: ['jqxEditorModule'],
      template: 



    `
    })
    export class AppComponent implements AfterViewInit {
    @ViewChild(‘editor’, { static: false }) editor!: jqxEditorComponent;

    ngAfterViewInit() {
    // you can also access editor reference here
    }

    onEditorChange(event: any): void {
    const newContent = event.args.html; // or event.args.text
    console.log(‘Editor content changed:’, newContent);

    // react accordingly, e.g. update a form control
    }
    }`

    Best regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.