Minor fix in tb-icon custom image feature - add alt attribute.

This commit is contained in:
deaflynx 2025-08-08 21:54:20 +03:00
parent f2e66ca012
commit a4cf5f7d32

View File

@ -304,6 +304,7 @@ export class TbIconComponent extends _TbIconBase
imageUrl => { imageUrl => {
const imgElement = this.renderer.createElement('img'); const imgElement = this.renderer.createElement('img');
this.renderer.addClass(imgElement, 'mat-icon'); this.renderer.addClass(imgElement, 'mat-icon');
this.renderer.setAttribute(imgElement, 'alt', 'Image icon');
this.renderer.setAttribute(imgElement, 'src', imageUrl as string); this.renderer.setAttribute(imgElement, 'src', imageUrl as string);
const elem: HTMLElement = this._elementRef.nativeElement; const elem: HTMLElement = this._elementRef.nativeElement;
this.renderer.insertBefore(elem, imgElement, this._iconNameContent.nativeElement); this.renderer.insertBefore(elem, imgElement, this._iconNameContent.nativeElement);