#Custom SvgIconResolver returning wrong svg

1 messages · Page 1 of 1 (latest)

vernal holly
#
    private _setupIconResolver() {
        this.matIconRegistry.addSvgIconResolver(
            (name: string, namespace: string): SafeResourceUrl | SafeResourceUrlWithIconOptions | null =>
                this.domSanitizer.bypassSecurityTrustResourceUrl(`../assets/svgs/${name}.svg`)
        );
    }
#

it seems to be caching the last used icon, here is how it looks with this:

#
<nav>
    <div class="logo-wrapper">
        <div class="icon">
            <mat-icon svgIcon="logo_back" class="back"></mat-icon>
            <mat-icon svgIcon="logo" class="front"></mat-icon>
        </div>
        <div class="typeface">
            <mat-icon svgIcon="typeface"></mat-icon>
        </div>
    </div>
</nav>
#

and if i move the typeface svg to before the logo svg they both show as typeface.

#

is this a bug with material 15 perhaps?