ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

#with helper don't work with `0`, `false` value and lost context

Open lexich opened this issue 11 years ago • 6 comments

Demo

Also reproduce for beta builds

lexich avatar Apr 27 '15 10:04 lexich

should ember render 'false'/0 in these cases ? ( just to confirm )

paganotoni avatar Apr 27 '15 15:04 paganotoni

Hey guys, not sure if this is the right approach, looking for guidance to make it better, at least it seems to solve this issue :)

cc @stefanpenner @wycats

paganotoni avatar Apr 27 '15 16:04 paganotoni

Same problem with null, undefined. IMHO, {{with}} should not work as {{if}}

glagola avatar Apr 27 '15 21:04 glagola

I believe that this is intentional behavior. We use the same semantics as {{if}} to determine if the template block should be renderd.

rwjblue avatar May 08 '15 02:05 rwjblue

We decided to go with the same {{if}} behavior for falsyiness, and that landed in https://github.com/emberjs/ember.js/issues/11035 (with docs added in https://github.com/emberjs/ember.js/pull/11075).

Thank you for reporting and taking a crack at fixing this issue!

rwjblue avatar May 09 '15 13:05 rwjblue

very strange decision...

lexich avatar May 09 '15 18:05 lexich