dimanche 6 mars 2016

handlebars.js renders blank rows for empty array

js, every thing works nicely except when an array is empty. I tried using if else but handlebars still render a blank row if array is empty.

                        {{#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}}                                                                                        




Aucun commentaire:

Enregistrer un commentaire