src/app/shared/excel-password-modal/excel-password-modal.service.ts
| providedIn | root |
Properties |
|
Methods |
constructor()
|
| close | ||||||
close(password?: string)
|
||||||
|
Parameters :
Returns :
void
|
| Public open | ||||||
open(openOptions?: OpenOptions)
|
||||||
|
Parameters :
Returns :
Observable<Result>
|
| Public optionsSubject$ |
Type : Subject<Options>
|
Default value : new Subject()
|
| Public resultChange$ |
Type : Subject<Result>
|
Default value : new Subject()
|
import { Injectable } from '@angular/core'
import { Subject, Observable } from 'rxjs'
import { OpenOptions, Options } from './models/options.interface'
import { Result } from './models/result.interface'
@Injectable({
providedIn: 'root'
})
export class ExcelPasswordModalService {
public optionsSubject$: Subject<Options> = new Subject()
public resultChange$: Subject<Result> = new Subject()
constructor() {}
public open(openOptions?: OpenOptions): Observable<Result> {
this.optionsSubject$.next({
open: true,
...openOptions
})
this.resultChange$ = new Subject<Result>()
return this.resultChange$.asObservable()
}
close(password?: string) {
this.optionsSubject$.next({
open: false
})
this.resultChange$.next({
password
})
this.resultChange$.complete()
}
}