以下ko js switch语句不起作用 - 如果数组的长度为> 0然后最后的陈述仍然显示。
<!-- ko switch -->
<!-- ko case: cards().length > 0 -->
<div id="cards-container" class="cards-container" data-bind="foreach: { data: cards }">
<div class="operator-card" data-bind="attr: {
'data-network': networkId,
'data-name': filters.name,
'data-ownership': filters.ownership,
'data-rating': filters.rating,
'data-country': filters.country,
'data-status': filters.status,
'data-status-number': filters.statusnumber,
'data-subscribers': filters.subscribers,
'data-marketshare': filters.marketshare,
'data-pricing-model': filters.pricingmodel,
'data-subscriptions': filters.subscriptions,
'data-refunds': filters.refunds
}">
<!-- MORE CODE HERE -->
<!-- /ko -->
<!-- ko case: $else -->
<h4>@Resources.GlobalResources.NoOperatorsFound</h4>
<!-- /ko -->
<!-- /ko -->