import { Component , ViewEncapsulation } from '@angular/core' ; import { Router } from '@angular/router' ; import { StockDataService } from 'src/app/services/stock-data.service' ; @ Component ( { selector : 'app-header' , templateUrl : './header.component.html' , styleUrls : [ './header.component.scss' ] , encapsulation : ViewEncapsulation . None } ) export class HeaderComponent { public listItems : Array < string > = [ 'USD' , 'EUR' , 'GBP' ] ; public selected = this . service . selectedCurrency ; constructor ( public router , private service ) { } public onCurrencyChange ( e ) { this . service . changeCurrency ( e ) ; } }