import { Injectable } from '@angular/core' ; import { ProgressBarInstance } from './progress-bar/progress-bar.types' ; @ Injectable ( { providedIn : 'root' } ) export class ProgressBarService { private private instances : { [ id ] : ProgressBarInstance ; } = { } ; param id public getInstance ( id = 'default' ) { if ( ! this . instances [ id ] ) { this . instances [ id ] = new ProgressBarInstance ( ) ; } return this . instances [ id ] ; } }