Knockoutjs isn't updating my UI when I change an observableArray

123a123

New Member
This is my template:\[code\]<tr> <td> <table> <thead> <th> <span>Option name:</span> </th> </thead> <tbody data-bind="template: {name: 'optionChoiceTemplate', foreach: choices, templateOptions:{choiceArray: choices} }"></tbody> </table> <button data-bind="click: function(){choices.push('');}">Add new</button> </td></tr>\[/code\]But when I click the "Add new" button, my view doesn't update to include the new option with the empty string. I've checked in the debugger that the empty string is added to the choices, and I've made sure that choices is an observableArray, what else might be going wrong?
 
Back
Top