mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-07 19:08:32 -05:00
added paperless ui
This commit is contained in:
26
src-ui/src/app/components/common/toasts/toasts.component.ts
Normal file
26
src-ui/src/app/components/common/toasts/toasts.component.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { Toast, ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-toasts',
|
||||
templateUrl: './toasts.component.html',
|
||||
styleUrls: ['./toasts.component.css']
|
||||
})
|
||||
export class ToastsComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(private toastService: ToastService) { }
|
||||
|
||||
subscription: Subscription
|
||||
|
||||
toasts: Toast[] = []
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.subscription.unsubscribe()
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.subscription = this.toastService.getToasts().subscribe(toasts => this.toasts = toasts)
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user