migrate angular 21 finalize
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {Component, Input, inject} from '@angular/core';
|
||||
import {File} from '../../services/file';
|
||||
import {getDownloadURL, ref, Storage} from '@angular/fire/storage';
|
||||
import {from, Observable} from 'rxjs';
|
||||
@@ -11,11 +11,11 @@ import {AsyncPipe} from '@angular/common';
|
||||
imports: [AsyncPipe],
|
||||
})
|
||||
export class FileComponent {
|
||||
private storage = inject(Storage);
|
||||
|
||||
public url$: Observable<string> | null = null;
|
||||
public name = '';
|
||||
|
||||
public constructor(private storage: Storage) {}
|
||||
|
||||
@Input()
|
||||
public set file(file: File) {
|
||||
this.url$ = from(getDownloadURL(ref(this.storage, file.path + '/' + file.name)));
|
||||
|
||||
Reference in New Issue
Block a user