ng-inline-svg icon indicating copy to clipboard operation
ng-inline-svg copied to clipboard

Any option to get the SVG without the div wrapper?

Open Eladigo opened this issue 3 years ago • 7 comments

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!!

Eladigo avatar Feb 04 '21 13:02 Eladigo

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

arkon avatar Feb 04 '21 13:02 arkon

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

Eladigo avatar Feb 04 '21 13:02 Eladigo

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

arkon avatar Feb 04 '21 13:02 arkon

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

Eladigo avatar Feb 18 '21 11:02 Eladigo

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.

arkon avatar Feb 18 '21 13:02 arkon

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

Eladigo avatar Feb 18 '21 15:02 Eladigo

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

vibonacci avatar Mar 22 '21 14:03 vibonacci