Search code examples
meteormeteor-blaze

Meteor templates, check if with or


I want to check a condition with or. how is it possible?

  {{#if  $.Session.equals 'showField' 'edit'}}

or

 {{#if  $.Session.equals 'showField' 'add'}}

Solution

  • As Blueren and Iiro said:

     {{#if or  ($.Session.equals 'showField' 'edit') ($.Session.equals 'showField' 'add') }}
    

    Then in clien/helpers folder make a js file and put this:

    Template.registerHelper('or',(a,b)=>{
      return a || b;
    });