How to use foreach with a special first element?

后端 未结 4 868
名媛妹妹
名媛妹妹 2021-01-03 23:48

If I have an observable array

foos = [{ name: \"a\" }, { name: \"b\" }, { name: \"c\" }]

on my viewmodel, I would like to render the follow

4条回答
  •  甜味超标
    2021-01-04 00:29

    This:

    • Static item

    will not work in IE8. I'm leaning toward the template answer for that situation. Any other ideas?

    EDIT: here is what worked in IE8 - knockout 2.2.1: using the options bindings as per the bottom of the following comment:

    https://stackoverflow.com/a/16361750

提交回复
热议问题