import { Injectable, OnInit } from '@angular/core'; import { Subject } from 'rxjs'; export interface PlacementInfo { placement: string; top: number; left: number; } @Injectable({ providedIn: 'root' }) export class TooltipService implements OnInit { /* tooltip位置 */ public placement$ = new Subject(); /* tooltip控制显示 */ public show$ = new Subject(); /* 计算位置 */ public calPosition$ = new Subject(); constructor() { } ngOnInit() { } }