This commit is contained in:
Phil Kunz
2018-09-14 21:02:17 +00:00
parent f078653846
commit df76935a52
9 changed files with 988 additions and 386 deletions

View File

@ -1,29 +1,29 @@
import * as handlebars from 'handlebars'
import * as handlebars from 'handlebars';
/**
* class Tlt allows templates to be used with different sets of data
*/
export class Tlt {
template: any
template: any;
/**
* constructor of class Tlt
*/
constructor(templateStringArg: string) {
this.template = handlebars.compile(templateStringArg)
this.template = handlebars.compile(templateStringArg);
}
/**
* returns template string with data applied
*/
applyData(data: any): string {
return this.template(data)
return this.template(data);
}
/**
* set a new template string
*/
setTemplate(templateStringArg: string) {
this.template = handlebars.compile(templateStringArg)
this.template = handlebars.compile(templateStringArg);
}
}