Skip to content

Commit a32e344

Browse files
committed
fix(icon): check name value for undefined
1 parent 577a894 commit a32e344

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

projects/coreui-icons-angular/src/lib/icon/icon.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class IconComponent implements IIcon, AfterViewInit {
2525
@Input() width?: string;
2626
@Input() height?: string;
2727

28-
@Input({ transform: (value: string) => value.includes('-') ? toCamelCase(value) : value }) name!: string;
28+
@Input({ transform: (value: string) => value && value.includes('-') ? toCamelCase(value) : value }) name!: string;
2929

3030
@Input()
3131
set viewBox(viewBox: string) {

projects/coreui-icons-angular/src/lib/icon/icon.directive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class IconDirective implements IIcon {
1919
@Input() width?: string;
2020
@Input() height?: string;
2121

22-
@Input({ transform: (value: string) => value.includes('-') ? toCamelCase(value) : value }) name!: string;
22+
@Input({ transform: (value: string) => value && value.includes('-') ? toCamelCase(value) : value }) name!: string;
2323

2424
@HostBinding('attr.viewBox')
2525
@Input()

0 commit comments

Comments
 (0)