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

RFC: Allow attribute selectors for SVG #208

Closed
SteveVanOpstal opened this issue Dec 30, 2016 · 6 comments
Closed

RFC: Allow attribute selectors for SVG #208

SteveVanOpstal opened this issue Dec 30, 2016 · 6 comments
Assignees

Comments

@SteveVanOpstal
Copy link

SteveVanOpstal commented Dec 30, 2016

SVG does not allow the use of custom elements like HTML5 does. SVG's will not render the contents of a custom element (example). The solution for that is to use attribute selectors (angular/angular#1632 (comment)).

Current behavior
Codelyzer does not allow attribute selectors on components (Due to style guide 05-03):

@Component({
  selector: 'g[appCustom]'
  ...

[tslint] The selector of the component "CustomComponent" should be named kebab-case and include dash (https://goo.gl/mBg67Z) (component-selector)

Desired behaviour
A new config for SVG components:

"svg-component-selector": [
  true,
  "element",
  "app",
  "camelCase"
],

The style guide does not mention SVG components and how to handle them but this comment confirms that SVG support is intended.

Figuring out if a component is an SVG component is quite easy as Angular 2 requires the svg namespace to be given on the root element (angular/angular#7216 (comment)).

@mgechev
Copy link
Owner

mgechev commented Jan 23, 2017

Sounds like a good to have feature. I'll include it into the backlog.

Until it's implemented, you can disable the rule for this file/component.

@mgechev
Copy link
Owner

mgechev commented Feb 19, 2017

Lets close the issue for now and reopen it if there's more interest.

@mgechev mgechev closed this as completed Feb 19, 2017
@yluijten
Copy link

@mgechev do you have any idea when this issue will be picked up?

@mgechev
Copy link
Owner

mgechev commented Nov 21, 2017

You can disable the codelyzer rule for a specific component.

@yluijten
Copy link

@mgechev can this one be reopened? Looks like there's enough interest for it.

@subramaniashiva
Copy link

I am facing the same issue. Would be happy if this reopened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants