我需要将我的.vm代码重写为handlebars语法并在SendGrid中使用。但是我有一个问题,因为我无法使用某些块帮助程序,例如with
,并且需要在每个循环内部更改this
上下文(我无法更改数据库)
我尝试编写车把代码:
{{#each $ctx.order.pickupOrderGroups}}
{{#each this.deliveryPointOfService.openingHours.weekDayOpeningList}}
{{this.weekDay}}, {{this.openingTime.formattedHour}},
{{/each}}
{{/each}}
我的.vm代码:
#foreach ($pickup in $ctx.order.pickupOrderGroups)
#foreach ($day in $pickup.deliveryPointOfService.openingHours.weekDayOpeningList)
${day.weekDay}, ${day.openingTime.formattedHour}
#end
#end