Skip to content

Commit

Permalink
fix(igoMatBadgeIcon): empty matBadge directive cause icondirective to… (
Browse files Browse the repository at this point in the history
#924)

* fix(igoMatBadgeIcon): empty matBadge directive cause icondirective to crash
  • Loading branch information
pelord authored Oct 15, 2021
1 parent 4d0c8b2 commit 9629b6e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/common/src/lib/badge-icon/badge-icon.directive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { Directive, Input, ElementRef, OnInit } from '@angular/core';
import { MatIconRegistry } from '@angular/material/icon';


/**
* This directive allow to add an icon inside a matBadge.
* A value must be set into the matBadge directive ex: matBadge="icon".
* The badge content will be overrided by this current directive.
*/
@Directive({
selector: '[igoMatBadgeIcon]'
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h4 mat-line matTooltipShowDelay="500" [ngClass]="(catalogAllowLegend)?'igo-cata
[color]="(isPreview$ | async) ? '' : added ? 'warn' : ''"
(click)="onToggleClick($event)">
<mat-icon
matBadge
matBadge="icon"
igoMatBadgeIcon="eye-off"
igoMatBadgeInverseColor="true"
[matBadgeHidden]="isInResolutionsRange()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<button class="only-visible" mat-icon-button [disabled]="layersAreAllVisible && !onlyVisible"
[color]="onlyVisible ? 'warn' : 'primary'" (click)="toggleOnlyVisible()">
<mat-icon
matBadge
matBadge="icon"
igoMatBadgeIcon="eye"
igoMatBadgeInverseColor="true"
igoMatBadgeInheritColor="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[color]="(isPreview$ | async) ? '' : added ? 'warn' : ''"
(click)="onToggleClick($event)">
<mat-icon
matBadge
matBadge="icon"
igoMatBadgeIcon="eye-off"
igoMatBadgeInverseColor="true"
[matBadgeHidden]="(inRange$ | async)"
Expand Down

0 comments on commit 9629b6e

Please sign in to comment.