Skip to content

Revert only-element-selector restraint on Component selectors #1602

Closed

Description

@jelbourn

Use case: for MdButton, there are actually two components, MdButton and MdAnchor. They are differentiated as
[md-button]:not([href]) and
[md-button][href]

Using only an element selector doesn't work for this.

Activity

  1. tbosch commented on Apr 30, 2015

    @tbosch
    Contributor

    Not blocking GT today (just double checked), but might in the future.

  2. jbdeboer commented on May 1, 2015

    @jbdeboer

    It is not blocking GT. I have also found that attribute selectors for components cause a lot of confusion and should be avoided.

    e.g. We have a component g-button[button-style=action] and developers are confused when does not work. (I realize that particular syntax is deprecated in A2, but the point stands)

  3. added this to the milestone on May 5, 2015
  4. removed this from the Backlog milestone on May 29, 2015
  5. DannyMeister commented on Jun 19, 2015

    @DannyMeister

    When fixed, will it follow reasonable selector specificity rules if there are potential collisions? For example, I would like to have a generic component for fields with a selector of field and more specialized components for some of them such as field[type=boolean]. Given the host element <field type="boolean"> both selectors would evaluate to true, but the second is the desired.

    If selectors have to be mutually exclusive, it forces (at the very least) the more generic component to know about all the others, causing deployment of a new component to require code modifications outside of itself. Not allowing this in order to help avoid collisions comes at the cost of extensibility (my components will have to remain open for modification).

  6. DannyMeister commented on Jun 24, 2015

    @DannyMeister

    I've switched tactics from Component selectors to using DynamicComponentLoader to try to overcome the limitations with selectors. That however, has been running into its own set of roadblocks, such as #1236

  7. self-assigned this
    on Jul 28, 2015
  8. added this to the alpha-34 milestone on Jul 28, 2015
  9. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  10. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions