lundi 29 juin 2020

Add if condition on array length directly in Handlebars template

In my Handlebars template, I want to enable/disable a button based on "selectedRows" array length (i.e. enable if selectedRows > 0 and disable it otherwise i.e. on array length 0) I want to avoid introducing any extra instance variable in the component JS. Is it possible to do this directly in handlebars ?

i.e. something like below


enabled is boolean (true/.false)




Aucun commentaire:

Enregistrer un commentaire