Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created March 14, 2024 12:21
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/e57346da4b5248e3ddcb4ee04d131a7a to your computer and use it in GitHub Desktop.
Save bjoerntx/e57346da4b5248e3ddcb4ee04d131a7a to your computer and use it in GitHub Desktop.
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