How to have if "string === string" in template?

Handlebars templates only have rudimentary boolean logic. You can do which checks the property for truthy values.

To do anything more complicated, you need to perform the logic in the Ember JS file associated with the template.

So say you have a template under templates/components/my-component.hbs. You’d have to use the JS file components/my-component.js to do the computation.

In that file you’d do something like this:

import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";

export default Component.extend({
  @discourseComputed("string1", "string2")
  property(string1, string2) {
    return string1 === string2;
  }
});

property is just the name of a function, but it could be any name.

Then in the template, you’d do something like this:

{{#if property}}
 blah blah...
{{/if}}

This pulls the computed property in from the JS file and shows the content in the #if block only if property returns true.