Dynamic Key Name in Dust.js
问题 I'm looking for a way to call a dynamic key in my dust template file, something like <table> {#array1} <tr> {#array2} <td>{#array1}{object.#dynAttrName#}{/array1}</td> {/array2} {/array1} </table> I would like to access to something like "object.attribute1" where 1 is the id of the current object in {array1}. (array1[n].id) Thank you for your Help ! 回答1: It can be done by adding a helper function to the context object: Context object: { get: function (chunk, context, bodies, params) { var obj