在 service里面
public isShowSubject: Subject<Object> = new Subject();
通過service
this.Service.isShowSubject.next(數據);
在其他組件中使用
this.Service.isShowSubject.subscribe((data) => {
console.log(data);
}