MAL Interest Stacks (#2932)
This commit is contained in:
parent
29eb65c783
commit
b23300b1a4
61 changed files with 4104 additions and 382 deletions
19
UI/Web/src/app/_pipes/safe-url.pipe.ts
Normal file
19
UI/Web/src/app/_pipes/safe-url.pipe.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { inject } from '@angular/core';
|
||||
import { Pipe, PipeTransform, SecurityContext } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
@Pipe({
|
||||
name: 'safeUrl',
|
||||
pure: true,
|
||||
standalone: true
|
||||
})
|
||||
export class SafeUrlPipe implements PipeTransform {
|
||||
private readonly dom: DomSanitizer = inject(DomSanitizer);
|
||||
constructor() {}
|
||||
|
||||
transform(value: string | null | undefined): string | null {
|
||||
if (value === null || value === undefined) return null;
|
||||
return this.dom.sanitize(SecurityContext.URL, value);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue