Myrdhin
November 21, 2016, 8:06pm
1
Does Ember support components organized in sub-directories ? see https://github.com/ember-cli/ember-cli/issues/1219#issuecomment-218873070
I use POD and i organize all my components in app/components/*
sub-directories:
app/components/forms/
app/components/table/
etc.
But, when i call my components in templates, i don’t know which notation to use:
{{#forms /test-field}}…{{/forms/test-field}}
OR
{{#forms .test-field}}…{{/forms.test-field}}
Both work… I prefer the second (with dot) because i prefer to keep the slash character to identify end of HTML and HTMLBars blocks.
What do you think? What is Ember’s recommended way of doing that (if it’s supported by Ember) ?
Use a slash, not a dot. Dots work sometimes but were never intended to work and may break in the future …
Myrdhin
November 23, 2016, 11:39am
3
Thank you.
But how will it work with (future) angle bracket components ?
Unclear on this, angle brackets haven’t officially been RFCed yet, so details on them are fuzzy.
parkie
January 13, 2023, 1:14am
5
Does anyone know how this works with the Octane ed?
ie Anglebrackets.
With octane we use ::
separator in templates to access components within a folder , and we use pascal case for naming ( capitalize the first letter and every letter after -
, then remove the hyphens) :
<Forms::TestField>…</Forms::TestField>