I'm doing knockout js. I have an array list coming from the database by making an ajax call and saving all the values in knockout observable array.
I'm looping through the array. Based on a value I want to check or uncheck the checkbox. Below is how I'm doing but this does not seems to be working. I can see values for roleid exists in the array but the checkbox is not checked if the value of roleid is true. What am i doing wrong here.
<tbody data-bind="foreach:$root.test">
<tr>
<div><input type="checkbox" value="1" data-bind="checked: roleid == 1"/></div>
</tr>
</tbody>