Hey guys,
I am trying to use the Blaze {{#if}} statement to check whether a variable equals a string, but it seems like Blaze is only capable of simple true/false checks in if statements. Here is my code:
Template.Agenda.helpers({
'event'(){
const id = instance.state.get('id');
return Events.findOne({_id:id});
}
});
{{#if event.status="Done"}}
<a class="waves-effect waves-light btn button-modal-white disabled">
{{else}}
<a class="waves-effect waves-light btn button-modal-white">
{{/if}}
It always shows me the option where the condition is true, regardless of what string I write (and without any string as well).
How can I get this string comparison done with Blaze without having to write one helper function for each?
Thanks!