Last active
December 22, 2020 13:58
-
-
Save bjoerntx/9d4fbd7ab6289cf16422469d1dad533a 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
export class AppComponent { | |
public _http: HttpClient; | |
private _mergeData: any; | |
private _dsDocumentProcessing: DsDocumentProcessingModule; | |
constructor(http: HttpClient) { | |
this._http = http; | |
this._dsDocumentProcessing = new DsDocumentProcessingModule(this._http); | |
// dummy merge data | |
this._mergeData = [{ | |
customer: [ | |
{ | |
name: "Peter Petersen", | |
company: "Software House", | |
}, | |
{ | |
name: "Jack Developer", | |
company: "Software Company", | |
} | |
], | |
}]; | |
} | |
@HostListener('document:dsDocumentEditorLoaded') | |
onDsDocumentEditorLoaded() { | |
// attached textControlLoaded event | |
TXTextControl.addEventListener("textControlLoaded", () => { | |
// fill reporting drop-down structure with dummy merge data | |
this._dsDocumentProcessing.loadData(this._mergeData); | |
}); | |
} | |
async onClickMergeDocument() { | |
// get the saved document from TXTextControl | |
let mergeBody: MergeBody = { | |
mergeData: this._mergeData, | |
template: await this._dsDocumentProcessing.saveDocument(), | |
mergeSettings: null | |
}; | |
this._dsDocumentProcessing.mergeDocument(mergeBody, 'TX'); | |
}; | |
} | |
class MergeBody { | |
mergeData: any; | |
template: any; | |
mergeSettings: string; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment