File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
projects/igniteui-angular/src/lib/badge Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 1- < div class ="igx-badge__circle " [ngClass] ="setClasses() " [attr.aria-roledescription] =" roleDescription " >
1+ < div class ="igx-badge__circle " [ngClass] ="setClasses() ">
22 < span *ngIf ="!icon " class ="igx-badge__circle-value "> {{value}}</ span >
33 < igx-icon *ngIf ="icon " fontSet ="material "> {{icon}}</ igx-icon >
44</ div >
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export class IgxBadgeComponent {
8787 * ```
8888 */
8989 @Input ( )
90- public value = '' ;
90+ public value : string | number = '' ;
9191
9292 /**
9393 * Sets/gets an icon for the badge from the material icons set.
@@ -153,19 +153,15 @@ export class IgxBadgeComponent {
153153 * @hidden
154154 * @internal
155155 */
156+ @HostBinding ( 'attr.aria-roledescription' )
156157 get roleDescription ( ) {
157- let message : string ;
158-
159158 // tslint:disable-next-line:prefer-conditional-expression
160159 if ( this . icon ) {
161- message = this . type + ' type badge with icon type ' + this . icon ;
162- } else if ( this . value ) {
163- message = this . type + ' badge type with value ' + this . value ;
164- } else {
165- message = this . type + ' badge type without value' ;
160+ return this . type + ' type badge with icon type ' + this . icon ;
161+ } else if ( this . value || this . value === 0 ) {
162+ return this . type + ' badge type with value ' + this . value ;
166163 }
167-
168- return message ;
164+ return this . type + ' badge type without value' ;
169165 }
170166
171167 /**
You can’t perform that action at this time.
0 commit comments