aurelia / templating-binding

An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.
MIT License
32 stars 26 forks source link

Bind null for <option> value #73

Closed StrahilKazlachev closed 8 years ago

StrahilKazlachev commented 8 years ago

I have the following <option value.bind="someValue"></option>. If someValue is null the value attribute is set to 'undefined'. Shouldn't it be 'null', and 'undefined' when someValue is undefined?

jdanyow commented 8 years ago

An html <option> element's value attribute only accepts strings. Anything you assign to it will be cast to a string.

To store null, undefined, numbers, objects, etc, use model.bind instead:

<option model.bind="someValue"></option>
StrahilKazlachev commented 8 years ago

I've missed that option, thanks.