Files
airport-chengdu-web/src/app/components/toast/toast.service.ts
T

25 lines
429 B
TypeScript
Raw Normal View History

2018-10-26 11:33:25 +08:00
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);
}
}