init commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Observable,Subject} from 'rxjs';
|
||||
import {ToastConfig} from './toast-model';
|
||||
|
||||
/**
|
||||
* toast服务
|
||||
*/
|
||||
@Injectable()
|
||||
export class ToastService {
|
||||
|
||||
private toastSubject = new Subject<ToastConfig>();
|
||||
|
||||
constructor() {}
|
||||
|
||||
getToasts(): Observable<ToastConfig> {
|
||||
return this.toastSubject;
|
||||
}
|
||||
|
||||
|
||||
toast(toastConfig: ToastConfig) {
|
||||
this.toastSubject.next(toastConfig);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user