Badge not showing on mat-icon if using svgIcon
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
Badge should be shown
What is the current behavior?
Badge is not shown
What are the steps to reproduce?
export class AppModule {
constructor(
private mdIconRegistry: MatIconRegistry,
private sanitizer: DomSanitizer) {
mdIconRegistry.addSvgIcon('bell',
sanitizer.bypassSecurityTrustResourceUrl('./assets/svg/bell.svg'));
}
}
in app.component.html
<mat-icon matBadge="15" matBadgeColor="primary" svgIcon="bell"></mat-icon>
you can see code on stackblitz.com, but here it svg icons imports do not word at all https://stackblitz.com/edit/angular-material2-issue-hjcqj2?embed=1&file=app/app.module.ts
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
6.0.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Angular Material icons not working - Stack Overflow
In my case the icons did not show up because I has screwed up my fonts by using !important. Taking that out caused...
Read more >How to: Use Angular Material's Mat-Icon with local SVG Images?
This component works with web fonts like Font-Awesome for instance, simply by adding the name of the image required and an image is...
Read more >How To Use Custom SVG Icons in Angular Material
I m able to register the icon in MatIconRegistry but nothing will be displayed when using it, like <mat-icon svgIcon="example"> . Is there...
Read more >How to: Using Mat-Icon — Part Two | by Duncan Faulkner
In my last post, I talked about using Angular Material's Mat-Icon component with local SVG images. Though the code worked, it was not...
Read more >Icon | Angular Material
This directive supports both icon fonts and SVG icons, but not ... To use a ligature icon, put its text in the content...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am working with Material 7.0.0 and I have the same problem, has this issue been fixed in later versions?
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.