import { Injectable } from '@angular/core' ; @ Injectable ( { providedIn : 'root' } ) export class SharedStylesHost { protected stylesSet = new Set < string > ( ) ; addStyles ( styles ) { const additions = new Set < string > ( ) ; styles . forEach ( style => { if ( ! this . stylesSet . has ( style ) ) { this . stylesSet . add ( style ) ; additions . add ( style ) ; } } ) ; this . onStylesAdded ( additions ) ; } onStylesAdded ( additions ) { } getAllStyles ( ) { return Array . from ( this . stylesSet ) ; } }