Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Any option to get the SVG without the div wrapper? #160

Open
Eladigo opened this issue Feb 4, 2021 · 7 comments
Open

Any option to get the SVG without the div wrapper? #160

Eladigo opened this issue Feb 4, 2021 · 7 comments
Labels

Comments

@Eladigo
Copy link

Eladigo commented Feb 4, 2021

Hi, For design reasons I want to get SVG without any wrapper, Is there any way to do it?
Like ng-container, who does not appear at all in the DOM.

Thanks!!

@arkon
Copy link
Owner

arkon commented Feb 4, 2021

You should be able to use the inline-svg component IIRC.

@Eladigo
Copy link
Author

Eladigo commented Feb 4, 2021

Thank you for your response! 😊
IDK why but angular don't recognize that component. (but do recognize the directive).

I tried these two options:

<inline-svg [inlineSVG]="'assets/img/icons/label.svg'"></inline-svg>
<inline-svg></inline-svg>

Got the following error:
image

@arkon
Copy link
Owner

arkon commented Feb 4, 2021

Whoops sorry. I think it's still the directive, but using the injectComponent and replaceContents inputs.

@Eladigo
Copy link
Author

Eladigo commented Feb 18, 2021

I'm sorry for the late response... but the solution does not remove the wrapper div..
image
image

@arkon arkon added the question label Feb 18, 2021
@arkon
Copy link
Owner

arkon commented Feb 18, 2021

Sorry, it's been a long time since I originally wrote this and I barely look at it nowadays. I don't think there's a way to just flat out replace your own "wrapper" element that's being used to actually apply the directive, but I also haven't used Angular in years so I wouldn't be the best person to give advice about that either.

@Eladigo
Copy link
Author

Eladigo commented Feb 18, 2021

Oh, wow, thank you for the effort and for your time!
And thanks for building this package.

@vibonacci
Copy link

This would be a very nice addition since that div wrapper makes the styling of the SVG a lot trickier.

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

No branches or pull requests

3 participants