diff --git a/README.md b/README.md index 343b427..d5c43ab 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ The SVG file (if found) will be inserted *inside* the element with the `[inlineS | forceEvalStyles | boolean | `false` | Forces embeded style tags' contents to be evaluated (for IE 11). | | evalScripts | `'always'`, `'once'`, `'none'` | `'always'` | Whether to evaluate embedded scripts in the loaded SVG files. The `SVGScriptEvalMode` enum is also provided. | | fallbackImgUrl | string | | URL for a regular image to be displayed as a fallback if the SVG fails to load. | +| fallbackSVG | string | | SVG filename to be displayed as a fallback if the SVG fails to load. | | onSVGLoaded | `(svg: SVGElement, parent: Element \| null) => SVGElement` | | Lifecycle hook that allows the loaded SVG to be manipulated prior to insertion. | #### Outputs diff --git a/demo/src/demo/demo.component.ts b/demo/src/demo/demo.component.ts index 80c8ad9..5bf9ee6 100644 --- a/demo/src/demo/demo.component.ts +++ b/demo/src/demo/demo.component.ts @@ -12,6 +12,7 @@ import { Component, OnInit } from '@angular/core';
+ ` }) export class DemoComponent implements OnInit { diff --git a/src/inline-svg.directive.ts b/src/inline-svg.directive.ts index 8741152..3289903 100644 --- a/src/inline-svg.directive.ts +++ b/src/inline-svg.directive.ts @@ -41,6 +41,7 @@ export class InlineSVGDirective implements OnInit, OnChanges, OnDestroy { @Input() forceEvalStyles: boolean = false; @Input() evalScripts: SVGScriptEvalMode = SVGScriptEvalMode.ALWAYS; @Input() fallbackImgUrl: string; + @Input() fallbackSVG: string; @Input() onSVGLoaded: (svg: SVGElement, parent: Element | null) => SVGElement; @Output() onSVGInserted: EventEmitter