mardi 20 janvier 2015

Ember.js: passing null in hbs to a component

When you pass "null" as a property value in handlebars like that:



{{my-example myProperty=null}}


then in the component, the value of myProperty is not null as expected but undefined.


So first I thought it can always interpret all the unquoted strings as the (let's say) controller properties. But if you write:



{{my-example myProperty=true}}


it is interpreted as the boolean value = true.


Shouldn't it be that at first, ember checks all the reserved words and then tries to find the properties of that name? Maybe I'm missing something.


The other thing is if the concept of passing null to a component is correct... but I just wanted to know whether I should post an issue.


The code:


JSFiddle: http://ift.tt/1uqi8pj





Aucun commentaire:

Enregistrer un commentaire