Block form component

AI-generated summary

A discussion about Ember components and the {{#name}} syntax. jamesmarkcook asked about the purpose of the # symbol and why a component is being called with ‘component’ in front of it. cpradio explained that the # symbol denotes block form and provided a link to the Ember documentation.

jamesmarkcook thanked cpradio for their help and further asked if components can exist without their own template file, referencing the discovery-categories component. cpradio confirmed this and explained that it depends on how the component is built and what it is extending. They provided examples of components built with and without templates.

I’m attempting my first plugin and have come across this in the codebase:

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

I’ve done some basic Ember recently, but haven’t come across the {{#name}} syntax yet.

I learnt to use components like (without the hash in the name):

{{component-name}}

Does the hash/pound symbol represent anything special? Is it even a component? And why is the categoryPageStyle component being called with ‘component’ in front of it?

Thanks!

Yes, and the # denotes block form (instead of inline)

Thanks for your help @cpradio

I’m also assuming that components can exist without having their own template file? (As there doesn’t appear to be one for discovery-categories.)

This is something I was also unaware of!

Yes, it depends how the component is built and what it is extending (if anything).

Example of using Buffered Render

Versus one that is utilizing a template