我正在研究一个录取通知书模板,该模板将根据从候选人列表中选择的候选人来替换/修改名称,地址,角色,薪水等动态数据点。动态数据点有固定的语法,即它们将包含在<<>>
中,例如:
Welcome to the family, <<Name>>
You will be paid <<Salary>> for the duration of your employment.
换句话说,这几个数据点将通过选择我们要提供的职位的候选人而改变,其余模板将保持不变。这是一个demo to help you understand。
这是我使用1个模板创建的虚拟数组,在实际应用中,我可以使用不同的ClauseNames拥有许多模板,因此我正在寻找永久性的修复方法。.ts文件,模板列表:
[{ templateId: 1, templateName: "Offer", clauses: [ { clauseName: "Introduction", clauseId: 1, texts: [ { text: "Hello <<Name>>, Welcome to the Machine", textId: 1, }] }, { clauseName: "Address", clauseId: 2, texts: [ { text: "<<Address>>", textId: 2, }] }, { clauseName: "Date Of Joining", clauseId: 3, texts: [ { text: "You can join us on <<DateOfJoining>>", textId: 3, }] }, ] }]
这是候选人名单,
candidateList = [
{ name: "Simba", address: "Some Random Cave" },
{ name: "Doe John", address: "line 4, binary avenue, Mobo" },
{ name: "B Rabbit", address: "8 mile road, Detroit" },
{ name: "Peter Griffin", address: "Spooner Street" },
{ name: "Speedy Gonzales", address: "401, hole 34, Slyvester Cat Road" },
{ name: "Morty", address: "Time Machine XYZ" },
{ name: "Brock", address: "pokeball 420, Medic center" },
]
我正在研究一个录取通知书模板,该模板将根据从候选人列表中选择的候选人来替换/修改名称,地址,角色,薪水等动态数据点。有固定的...