Declined
Last Updated: 20 Nov 2014 19:22 by ADMIN
Stacey
Created on: 10 Aug 2013 20:21
Category: MVVM
Type: Feature Request
10
Flow Control Bindings for MVVM
It would be nice to have some additional "flow control" for the MVVM framework, including ...

"if" -

<div data-bind="if: [property]">
    // renders if the given value is true
</div>

and "not"

<div data-bind="not: enabled">
// renders if the given value is false
</div>

and "each"
<div data-bind="each: array">
// renders this section for each item in the array given
</div>

I know some of this can be achieved with templates, but this would make it very convenient and mean we did not have to use templates everywhere, and could lead to much more natural coding.
1 comment
Stacey
Posted on: 02 Oct 2013 15:26
Unfortunately, you are wrong. The source binding only works when you give it a template, it does not work with any kind of inline behavior, which is much more desirable and simpler to build and maintain.