2012-06-01 7 views

risposta

6

Pochi giorni fa, un push on the master risolto il problema: uso Ember.Handlebars.registerBoundHelper.

Ember.Handlebars.registerBoundHelper('myHelper', 
    function(myBinding, options) { 
     return myDealWith(myBinding); 
    } 
); 
+0

Non si può fare con oggetti di blocco. – iConnor

4

È necessario utilizzare Ember.getPath per ottenere il valore nel metodo di supporto.
Vedere la documentazione http://emberjs.com/documentation/#toc_writing-custom-helpers

+0

C'è una ragione per cui dovrei usare 'Ember.getPath (this, property)' su 'this.getPath (proprietà)'? – hekevintran

+2

Si vorrebbe usare 'Ember.getPath' se ci si aspetta che' this' non sia un 'Ember.Object'. – ebryn

+0

... vale a dire, la maggior parte delle volte è possibile (e dovrebbe) usare 'this.getPath'. –

Problemi correlati