Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created January 30, 2023 15:34
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/c9bb9fa3068a383f385ed52dcb45f879 to your computer and use it in GitHub Desktop.
Save bjoerntx/c9bb9fa3068a383f385ed52dcb45f879 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
declare const jsInsertTable: any;
declare const jsAddMergeField: any;
declare const jsSetMergeFieldText: any;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'my-editor-app';
// TypeScript wrapper function
tsInsertTable(cols: number, rows: number, id: number) {
// call JavaScript
jsInsertTable(cols, rows, id);
}
// TypeScript wrapper function
tsAddMergeField(name: string, text: string) {
// call JavaScript
jsAddMergeField(name, text);
}
// TypeScript wrapper function
tsSetMergeFieldText(text: string) {
// call JavaScript
jsSetMergeFieldText(text);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment