handlebars.js呈现空数组的空行

时间:2016-03-06 12:51:26

标签: javascript ember.js handlebars.js

js,除了数组为空外,每件事都很好用。我尝试使用if else,但如果数组为空,手柄仍然会呈现一个空行。

{{#each invoice_id.invoice_services}}                       
    <tr class="uk-table-middle">
        <td>
            <span class="uk-text-large">{{ service_name }}</span><br/>
            <span class="uk-text-muted uk-text-small">{{ service_description }}</span>
        </td>
        <td>
            {{ service_rate }}
        </td>
        <td class="uk-text-center">
            {{ service_hours }}
        </td>
        <td class="uk-text-center">
            {{ service_vat }}
        </td>
        <td class="uk-text-center">
           {{ service_total }}
        </td>
    </tr>                                                 
{{/each}}

0 个答案:

没有答案