You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Revert only-element-selector restraint on Component selectors #1602
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.
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)
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).
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
Activity
tbosch commentedon Apr 30, 2015
Not blocking GT today (just double checked), but might in the future.
jbdeboer commentedon May 1, 2015
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)DannyMeister commentedon Jun 19, 2015
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
fieldand more specialized components for some of them such asfield[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).
DannyMeister commentedon Jun 24, 2015
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
angular-automatic-lock-bot commentedon Sep 6, 2019
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.