Reputation: 90
It is possible to make binding like
<ul data-foreach="myArray">
<li data-text='title'></li>
</ul>
or
<ul data-bind-foreach="myArray">
<li data-bind-text='title'></li>
</ul>
instead of
<ul data-bind="foreach: myArray">
<li data-bind='text: title'></li>
</ul>
Upvotes: 2
Views: 58
Reputation: 11
Doing what your asking would require a lot of work. Another option could possibly writing a custom binding handler if your looking for specific functionality for something.
<ul data-bind="someBinding: myArray">
<li data-text='title'></li>
</ul>
http://knockoutjs.com/documentation/custom-bindings.html
Upvotes: 0
Reputation: 63830
You're probably not gonna like my answer... AFAIK: No, with just Knockout this isn't really an option.
The KO 3.0 plugin Knockout.Punches may do similar things, you could have a look at that.
Other than that you'd have to write your own extension to KO.
Upvotes: 1