question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Badge not showing on mat-icon if using svgIcon

See original GitHub issue

Bug, 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ZouZoucommented, Dec 21, 2018

I am working with Material 7.0.0 and I have the same problem, has this issue been fixed in later versions?

0reactions
angular-automatic-lock-bot[bot]commented, Sep 10, 2019

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.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found