javascript - Meteor - If Statements in .html -


i using fs collection called "myuploads" store files user has uploaded. in html, have created submit button. question is, how create if statement such submit button:

<input type="submit" name="parseuploads">

is visible if size of collection greater 0?

note-- have created following helper function in .js determine total count (the size) of files uploaded collection:

filecount: function () {   return myuploads.find().count(); } 

you make helper return boolean

filecountmorethanone: function () {   return myuploads.find().count() > 0; } 

and use follow:

{{#if filecountmorethanone }}     <input type="submit" name="parseuploads"> {{/if}} 

Comments