javascriptjqueryhtmlmeteormeteor-packages

Expected space error issue with gadicc/meteor-reactive-window Meteor Package


Using gadicc/meteor-reactive-window Meteor Package to display diffrent template depending upon the screen size. This is pictureDisplatSection.html File

            <template name="pictureDisplaySection">
                <div class="display">

                {{#if rwindow.screen('lte','small') }}
                    {{> small}}         
                {{else}}        
                    {{> large}}         
                {{/if}}

                Current jQuery(window).width() is {{rwindow.$width}}
                </div>

            </template>

            <template name="small">
                I am Small
            </template>
            <template name="large">
                I am Large
            </template>

This code has started working intially but out of the blue it has started giving this error

While building the application: client\template\pictureDisplaySection.html: 4 : Expected space ... {{#if rwindow.screen('lte','small') }} ... ^

Your application has errors. Waiting for file change.

I have tried to find more information but no luck till now. Really appreciate some help.

Thanks !!!


Solution

  • It seems a syntax error. Inside the if block, the function receives arguments with a space separated instead of parenthesis (..,..,)怂

    {{#if rwindow.screen 'lte' 'small'}}
      {{> small}}         
    {{else}}        
      {{> large}}         
    {{/if}}