Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created August 7, 2020 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/7924f023a0806ae3436d37aec150aa3e to your computer and use it in GitHub Desktop.
Save bjoerntx/7924f023a0806ae3436d37aec150aa3e to your computer and use it in GitHub Desktop.
import { Component, HostListener } from '@angular/core';
declare const TXTextControl: any;
declare const loadDocument: any;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
// attach the txDocumentEditorLoaded event in the @HostListener decorator
// https://angular.io/api/core/HostListener
@HostListener('document:txDocumentEditorLoaded', ['$event'])
onTxDocumentEditorLoaded() {
// wait until TXTextControl has been loaded
TXTextControl.addEventListener("textControlLoaded", function() {
loadDocument("<strong>Hey! It compiles! Ship it!</strong>");
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment