map-data.service.ts 322 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class MapDataService {

  mapDataSubject = new Subject<any>(); //Decalring new RxJs Subject

  constructor() { }

  sendDataToOtherComponent(somedata) {
    this.mapDataSubject.next(somedata);
  }

}