You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug.
When using Angular Universal, if custom icon set is provided to matIconRegistry through .addSvgIconSet or .addSvgIconSetInNamespace, error shows in console:
Error retrieving icon: NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML.
and icon is not shown in template (<mat-icon [svgIcon]="icon"></mat-icon>)
Show icons from icon set on templates and no error in console
What is the current behavior?
Icons from icon set are not shown in templates and mentioned error occurs in console.
What are the steps to reproduce?
import{Component,OnInit,Inject}from'@angular/core';import{MatIconRegistry}from'@angular/material';import{DomSanitizer}from'@angular/platform-browser';import{PLATFORM_ID}from'@angular/core';import{isPlatformBrowser,isPlatformServer}from'@angular/common';
@Component({selector: 'app-root',templateUrl: './app.component.html',styleUrls: ['./app.component.scss']})exportclassAppComponentimplementsOnInit{constructor(private_matIconRegistry: MatIconRegistry,private_domSanitizer: DomSanitizer, @Inject(PLATFORM_ID)privateplatformId: string){constsvgUrl='assets/icons/symbol-defs.svg';constdomain=(isPlatformServer(platformId)) ? 'http://localhost:4000/' : '';// this doesn't work on ssrthis._matIconRegistry.addSvgIconSet(this._domSanitizer.bypassSecurityTrustResourceUrl(domain+svgUrl));// this also// this._matIconRegistry.addSvgIconSetInNamespace('ui', this._domSanitizer.bypassSecurityTrustResourceUrl(domain + svgUrl));}ngOnInit(){}}
What is the use-case or motivation for changing an existing behavior?
Mentioned issue is closed with explanation that this is Domino issue. Domino released version 2.0.1 that includes fix, but bug remains when using svg icon sets.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
I don’t think you understand the real issue: Universal (which lives in @angular/platform-server) is the one that depends on domino. Material has nothing to do with this. Not only that, but this will be patched in the next beta release for Angular.
This can be closed since it’s not a Material issue.
Fixes the `MatIconRegistry` throwing a namespace error on the server due to the `xmlns` attribute. These changes remove the attribute, because it's optional under HTML5.
Fixesangular#10170.
…0175)
Fixes the `MatIconRegistry` throwing a namespace error on the server due to the `xmlns` attribute. These changes remove the attribute, because it's optional under HTML5.
Fixes#10170.
Bug, feature request, or proposal:
Bug.
When using Angular Universal, if custom icon set is provided to matIconRegistry through .addSvgIconSet or .addSvgIconSetInNamespace, error shows in console:
Error retrieving icon: NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML.
and icon is not shown in template (
<mat-icon [svgIcon]="icon"></mat-icon>
)As referenced here: #9519
it is Domino issue and it is fixed with latest version 2.0.1,
but here bug remains:
What is the expected behavior?
Show icons from icon set on templates and no error in console
What is the current behavior?
Icons from icon set are not shown in templates and mentioned error occurs in console.
What are the steps to reproduce?
What is the use-case or motivation for changing an existing behavior?
Mentioned issue is closed with explanation that this is Domino issue. Domino released version 2.0.1 that includes fix, but bug remains when using svg icon sets.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Is there anything else we should know?
Adding individual icons to registry (with both default and custom namespace) works as it should
The text was updated successfully, but these errors were encountered: