Skip to content

Use data-targets for @targets  #34

@muan

Description

@muan

Given

@targets filters: HTMLElement[]
@target allFilter: HTMLElement

Currently this is the markup

<div data-target="foo-controller.filters foo-controller.allFilter"></div>

I propose that we add data-targets, like so:

<div data-targets="foo-controller.filters" data-target="foo-controller.allFilter"></div>

In this case we see from the markup that this is supposed to be the only one allFilter, but there should be multiple filters.

I think data-targets will

  1. Match with the decorator thus make it clearer that to find a collection you need @targets in TS.
  2. Provide better context when looking at the markup. When refactoring unfamiliar, JS we often have to check "is this thing rendered more than one time?"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions