Skip to content Skip to sidebar Skip to footer

Knockoutout Js - Why Are These Values Not Binding Correctly?

I have this knockout observable array and I am trying to bind some of its values to my view. Where I am having difficulties is because its nested. I am not sure what the correct da

Solution 1:

Because your advertiser is ko.observable you need to get its value with advertiser() if you are using it inside an expression:

<table><tr><td><inputdata-bind="value: advertiser().advertiserName" /></td><td><inputdata-bind="value: advertiser().advertiserRank" /></td></tr></table>

Or you can use the with binding:

<tabledata-bind="with: advertiser"><tr><td><inputdata-bind="value: advertiserName" /></td><td><inputdata-bind="value: advertiserRank" /></td></tr></table>

Post a Comment for "Knockoutout Js - Why Are These Values Not Binding Correctly?"