mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-05 23:53:21 +00:00
* angular 18 upgrade * wip * wip * remove @types/glob, fix jest version, use standalone: false * clean up * npm ci
16 lines
372 B
TypeScript
16 lines
372 B
TypeScript
import { Directive, ElementRef, HostListener, Input } from "@angular/core";
|
|
|
|
@Directive({
|
|
selector: "[appFallbackSrc]",
|
|
standalone: false,
|
|
})
|
|
export class FallbackSrcDirective {
|
|
@Input("appFallbackSrc") appFallbackSrc: string;
|
|
|
|
constructor(private el: ElementRef) {}
|
|
|
|
@HostListener("error") onError() {
|
|
this.el.nativeElement.src = this.appFallbackSrc;
|
|
}
|
|
}
|