I am using knockout foreach to return data. I would like to do a filter that when the return data = 0, I don't want to show it as 0, just blank. Otherwise, just show the number.
<tbody data-bind="foreach: modeldimsub">
<tr>
<td data-bind="text: $data.NumberOfElements > 0 ? $data.NumberOfElements : ''"></td>
</tr>
</tbody>
I've tried the above and it's just returning blank. I've also tried using $data.NumberOfLements() > 0 , this one is stuck.
Is it possible to do a logic compare on knockout?
Aucun commentaire:
Enregistrer un commentaire