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

Input applyClass does not take in account [class.name] and [ngClass] #123

Open
MickL opened this issue Feb 19, 2021 · 2 comments
Open

Input applyClass does not take in account [class.name] and [ngClass] #123

MickL opened this issue Feb 19, 2021 · 2 comments

Comments

@MickL
Copy link
Contributor

MickL commented Feb 19, 2021

When applyClass using both [class.name] and [ngClass] are not applied:

<svg-icon src="assets/icons/arrow.svg" class="icon" [ngClass]="{'icon-lg': true}" [class.icon-lg]="true" [applyClass]="true"></svg-icon>

Results in:

<svg ... class="icon"></svg>
@indraraj26
Copy link

I think we can read it through this.el.nativeElement.classList then just pass it down to this.setClass

@RaminGe
Copy link

RaminGe commented Apr 3, 2024

It's an old issue but for anyone stumbling across, a workaround is setting the classes like this:

 <svg-icon
        src="icon.svg"
        [applyClass]="true"
        class="{{ size === 'small' ? 'h-3 w-3' : 'h-4 w-4' }}"
></svg-icon>

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