との差が、ここでは代表的なハンドルバーヘルパーは何です:Handlebarsヘルパーにパラメータを渡す方法は? options.hash&options.data
Ember.Handlebars.helper 'myHelper', (value, options) ->
...
this protipによると、あなたがハンドルバーヘルパーにハッシュを渡すことができます。私はソースを見て、それがoptions.hash
とoptions.data
の両方を提供することを発見しました。私は予想通り、これは動作しないだろうと少し困惑している:
{{#with controllers.currentCardCategory}}
{{#each property in cardProperties}}
<td class="td">{{cardProperty this property=property.symbol}}</td>
{{/each}}
{{/with}}
this
は、現在のCard
レコードです。ここで私は、文字列
としてproperty.symbol
を得たが、これは働いていた:
{{#with controllers.currentCardCategory}}
{{#each property in cardProperties}}
<td class="td">{{cardProperty this property.symbol}}</td>
{{/each}}
{{/with}}
をし、値がoptions
経由でアクセスできました。
しかし、今、私はこれを行うことはできません。
{{#with controllers.currentCardCategory}}
{{#each property in cardProperties}}
<td class="td">{{cardProperty this property.symbol anotherParam yetAnotherParam}}</td>
{{/each}}
{{/with}}
私の質問は:ヘルパーに他のパラメータを渡す方法とヘルパーでoptions.hash
とoptions.data
の違いは何ですか?