How to share service data between components correctly in Angular 2
I want to create a service to get data from .json file once and share it to multiple subscribers. But now with my solution number of requests to get data from .json file equals to a number of a subscibers for my service. getconfig.service.ts import {Injectable} from 'angular2/core'; import {Http, Response} from "angular2/http"; @Injectable() export class ConfigService { config: any; http: Http; constructor(http: Http) { this.http = http; console.log('Inside service'); this.config = this.http.get('/config.json'); } } robotui.component.ts ... import {ConnectionService} from '../services