Ember template convention

I’m trying to understand EmberJS template convention in Discourse.
Here’s a snippet from app/assets/javascripts/discourse/templates/discovery/categories.hbs

{{#discovery-categories refresh="refresh"}}
  {{component controller.categoryPageStyle
              categories=model.categories
              latestTopicOnly=controller.latestTopicOnly
              topics=model.topics}}
  {{!-- my-template --}}
{{/discovery-categories}}

What is the meaning of discovery-categories and component?
For example I want to insert my-template to extend categories.hbs, what is the convention I should use to create file with template?

discovery-categories is this component. It’s used to display categories in the home pages.

component is an Ember helper which allows to insert components dynamically :wink:

2 Likes

Could you explain more explicitly? What is the block style {{#d}}…{{/d}}?

That’s the block syntax in handlebars.

I suggest you go through the handlebars doc and the Ember Guides to learn more.

3 Likes