UNPKG

@angulogic/ng-sidebar

Version:

angular sidebar - standalone components

41 lines (40 loc) 1.7 kB
import { SafeHtml, DomSanitizer } from '@angular/platform-browser'; import { NgSidebarService } from '../../ng-sidebar.service'; import * as i0 from "@angular/core"; /** * A component that dynamically loads and displays SVG icons or image sources. * If an SVG file is provided, it fetches and sanitizes it to prevent security risks. * Otherwise, it renders an image element with the given source. * * @export * @class AlIconComponent */ export declare class AlIconComponent { private sanitizer; private sidebarService; /** * Stores the sanitized SVG content or image element. * The content is directly bound to the component's `innerHTML`. */ safeSvg: SafeHtml | undefined; /** * Stores the image source URL when an image (non-SVG) is provided. */ imgSource?: string; /** * Sets the source of the icon. If an SVG file is detected, it is loaded and sanitized. * Otherwise, an image element is created. * * @param {string | undefined} content - The source URL or inline SVG content. */ set icon(content: string | undefined); /** * Creates an instance of `AlIconComponent`. * * @param {DomSanitizer} sanitizer - Angular's sanitizer service to bypass security restrictions. * @param {NgSidebarService} sidebarService - The sidebar service used to fetch SVG content. */ constructor(sanitizer: DomSanitizer, sidebarService: NgSidebarService); static ɵfac: i0.ɵɵFactoryDeclaration<AlIconComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<AlIconComponent, "al-icon", never, { "icon": { "alias": "icon"; "required": false; }; }, {}, never, never, true, never>; }