Angular6 如何在路由组件中检测AppComponent的更改?
无论什么时候我要对货币代码进行更改,它在 AppComponent它也应该反映在CurrencyExchangeComponent中Angular6 如何在路由组件中检测AppComponent的更改?,angular6,router-outlet,Angular6,Router Outlet,无论什么时候我要对货币代码进行更改,它在 AppComponent它也应该反映在CurrencyExchangeComponent中 export class AppComponent implements OnInit { currencyCode: string = 'INR'; changeCurrency(currencyCode:string){ this.currencyCode = currencyCode; } } expor
export class AppComponent implements OnInit {
currencyCode: string = 'INR';
changeCurrency(currencyCode:string){
this.currencyCode = currencyCode; }
}
export class CurrencyExchangeComponent{
fromCurrency:string = 'INR';
toCurrency:string = 'INR';
exchangeCurrency(){
//service call
}
}