Check for null value in object in if statement in jquery tmpl

1k views Asked by At

I am quite new to jquery tmpl. I need to check if a certain value is null or not inside if condition. I have the following template:

<div class="ui-body">
    {{if !${provider}}}
       <span>Provider is ok</span>
    {{/if}}
</div>

Whenever I try to bind the following object with the template:

{ 
   provider:null
}

but in return I get the following error:

unexpected token {

1

There are 1 answers

0
AL-zami On

Looks like for checking conditional statement ,no $ sign or curly brace is required.I did it like the following and it works:

{{if provider }}

it checks if the condition is truthy or falsy against the variable provider