Skip to content

Nested components with <AngleBrackets /> #428

@izelnakri

Description

@izelnakri

Hi there,

I started using <AngleBrackets /> for the first time this weekend and found some important issues I would like to raise.

Previously I've been using nested components to group my form and modal window components. Example:

{{ab-modal/confirmation-window}}

<!-- or: -->

{{ab-form/input}}

<!-- which could be used after yielded on: -->

{{#ab-form model=model.blogPost as |form|}}
  {{form.input attribute="title"}}

  {{form.date attribute="publishedAt"}}

  {{#form.button "success"}}Save{{/form.button}}
{{/ab-form}}

For larger applications grouping form and modal related components under a folder make a lot of sense and encourages greater level of usability when it comes to functionality and naming.

New syntax works for block-level forms:

<Form @model=model.blogPost as |form|>
  <form.input @attribute="title" />

  <form.date @attribute="publishedAt" />

  {{#form.button "success"}}Save{{/form.button}}
</Form>

However we also need to support nested level components, which is not supported currently. I think this is a major requirement for angle-brackets components in order it to be a true replacement for curly-braced components. I suggest the following syntax:

<Modal.ConfirmationModal />

<!-- or -->

<Form.input @attribute="publishedAt" />

I can explain further why this is necessary if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions