Created
March 14, 2024 12:21
-
-
Save bjoerntx/e57346da4b5248e3ddcb4ee04d131a7a 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 } from '@angular/core'; | |
import { CommonModule } from '@angular/common'; | |
import { RouterOutlet } from '@angular/router'; | |
import { DocumentEditorModule } from '@txtextcontrol/tx-ng-document-editor'; | |
declare const saveDocument: any; | |
declare const loadDocumentFromUrl: any; | |
declare const TXTextControl: any; | |
@Component({ | |
selector: 'app-root', | |
standalone: true, | |
imports: [CommonModule, RouterOutlet, DocumentEditorModule], | |
templateUrl: './app.component.html', | |
styleUrl: './app.component.css' | |
}) | |
export class AppComponent { | |
async onClickSave() { | |
var base64Document = await saveDocument(TXTextControl.StreamType.InternalUnicodeFormat); | |
console.log(base64Document); | |
} | |
onClickLoad() { | |
loadDocumentFromUrl("http://yourdomain/getDocument?filename=demo.tx"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment