Created
August 7, 2020 09:24
-
-
Save bjoerntx/7924f023a0806ae3436d37aec150aa3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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