<button mat-flat-buton>
<mat-icon matBadge="1">home</mat-icon>
</button>
<button mat-flat-buton>
<mat-icon matBadge="!">home</mat-icon>
</button>
I've checked the html and I see the span with the text there
any help would be really appreciated, thanks!
The property matBadge
only accepts icons of material-icons
, the reason you are not able to view the text is because of the property font-family: 'Material Icons';
from the class .material-icons
, we can override this with the below SCSS
Componnent level using ::ng-deep
::ng-deep .show-text-on-badge > mat-icon > span {
font-family: initial !important;
}
Global style level
.show-text-on-badge > mat-icon > span {
font-family: initial !important;
}
We can add the class (.show-text-on-badge
) to configure it to accept text.
<button mat-flat-buton class="show-text-on-badge">
<mat-icon matBadge="1">home</mat-icon>
</button>
You can style the text to your liking using the above method.