Knockout binding doesn't update using array of simple observables

后端 未结 1 1048
迷失自我
迷失自我 2021-01-19 14:56

I have a list of strings in my view model. To edit them, I want each to appear as an

  • with a textbox, and a
  • 相关标签:
    1条回答
    • 2021-01-19 15:21

      Knockout does not currently work well with an array of pure observables (issue logged here).

      To make this work properly, you need your items to be objects that hold observables like:

      { val: ko.observable("something") }
      

      Here is your fiddle updated to use these type of objects: http://jsfiddle.net/rniemeyer/GgFa9/

      0 讨论(0)
    提交回复
    热议问题