Module

lib/directives/NgxSvgDirective

Standalone directive that inlines SVG assets into the host element.

View Source lib/directives/svg.directive.ts, line 8

Classes

NgxSvgDirective

Standalone directive bound to the [ngx-decaf-svg] attribute selector. On initialisation it resolves the SVG asset path from the [ngx-decaf-svg] input binding or, as a fallback, the host element's native src attribute. Once a non-empty path is determined it calls NgxMediaService.loadSvgObserver, which performs the HTTP request via HttpClient and injects the SVG markup directly into the host element's DOM, enabling full CSS styling of the inlined SVG.

Members

ElementRef

# static DecafTooltipDirective#element

Obtained via Angular's inject(ElementRef). Provides access to the native element forwarded to NgxMediaService.loadSvgObserver as the injection target, and used as a fallback source for the src attribute when path is not set.

Reference to the host DOM element into which the SVG will be injected.

View Source lib/directives/tooltip.directive.ts, line 118

ElementRef

# static NgxSvgDirective#element

Obtained via Angular's inject(ElementRef). Provides access to the native element forwarded to NgxMediaService.loadSvgObserver as the injection target, and used as a fallback source for the src attribute when path is not set.

Reference to the host DOM element into which the SVG will be injected.

View Source lib/directives/svg.directive.ts, line 132

HttpClient

# static NgxSvgDirective#http

Injected HttpClient passed directly to NgxMediaService.loadSvgObserver so the service can issue the GET request for the SVG file without managing its own HTTP dependency.

HTTP client instance forwarded to the media service for the SVG fetch.

View Source lib/directives/svg.directive.ts, line 142

NgxMediaService

# static NgxSvgDirective#mediaService

Injected NgxMediaService instance used by ngOnInit to perform the HTTP request and inject the resulting SVG markup into the host element's DOM.

Service responsible for fetching and inlining the SVG markup.

View Source lib/directives/svg.directive.ts, line 122

string

# static NgxSvgDirective#path

Bound via the [ngx-decaf-svg] attribute. When empty or not provided, the directive falls back to reading the host element's native src attribute during ngOnInit.

URL or asset path to the SVG file to inline.

View Source lib/directives/svg.directive.ts, line 113

ElementRef

# static element

Obtained via Angular's inject(ElementRef). Provides access to the native element forwarded to NgxMediaService.loadSvgObserver as the injection target, and used as a fallback source for the src attribute when path is not set.

Reference to the host DOM element into which the SVG will be injected.

View Source lib/directives/svg.directive.ts, line 64

ElementRef

# static element

Obtained via Angular's inject(ElementRef). Provides access to the native element forwarded to NgxMediaService.loadSvgObserver as the injection target, and used as a fallback source for the src attribute when path is not set.

Reference to the host DOM element into which the SVG will be injected.

View Source lib/directives/tooltip.directive.ts, line 55

HttpClient

# static http

Injected HttpClient passed directly to NgxMediaService.loadSvgObserver so the service can issue the GET request for the SVG file without managing its own HTTP dependency.

HTTP client instance forwarded to the media service for the SVG fetch.

View Source lib/directives/svg.directive.ts, line 73

NgxMediaService

# static mediaService

Injected NgxMediaService instance used by ngOnInit to perform the HTTP request and inject the resulting SVG markup into the host element's DOM.

Service responsible for fetching and inlining the SVG markup.

View Source lib/directives/svg.directive.ts, line 55

string

# static path

Bound via the [ngx-decaf-svg] attribute. When empty or not provided, the directive falls back to reading the host element's native src attribute during ngOnInit.

URL or asset path to the SVG file to inline.

View Source lib/directives/svg.directive.ts, line 47

Methods

# static NgxSvgDirective#ngOnInit() → {void}

Trims path and, when empty, falls back to the host element's src attribute. When a valid path is found, delegates to NgxMediaService.loadSvgObserver to fetch the file and inject the SVG markup into the host element.

Resolves the SVG path and triggers the inline load.

View Source lib/directives/svg.directive.ts, line 152

void