Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow components/directives to use both element and attribute as selectors #307

Closed
diagramatics opened this issue May 11, 2017 · 2 comments

Comments

@diagramatics
Copy link

Right now directive-selector and component-selector chooses between using attribute or element as the type, but you can't actually use both. I'd like to make a case for supporting having the two if it's not possible yet.

After listening to Angular Material team's talk in ng-conf about component API designs there is a case for using attribute selectors as components to allow components to be able to use the DOM API without needing to reflect 20+ bindings from the custom element style components to the inner DOM API it wraps. angular/material2 itself uses directives — which I'm not sure why directives instead of components — my case for using components would be for the scoped styling it provides compared to directives, which angular/material2 doesn't need to yet with their approach to having a global stylesheet with all the styles of the components.

I don't have a use case example for directives yet though, but considering the configuration of both rules are the same, maybe it's worth giving people the option to anyway.

@mgechev
Copy link
Owner

mgechev commented May 11, 2017

It's already possible to pass an array with elements ["element", "attribute"] for both. Another alternative is to disable the rules.

@mgechev mgechev closed this as completed May 11, 2017
@diagramatics
Copy link
Author

Ah my bad, thanks for the clarification.

mgechev pushed a commit that referenced this issue Aug 8, 2018
* Update doc for both element and attribute rule

Related to bug #307

* Shorten sentence for both items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants