Parent-child relationships with input binding

By definition, your parent component will be aware of what child components it is working with. Since the currentWeather property is bound to the current property on the current-weather component, the results pass down to be displayed. This is achieved by creating an @Input property:

src/app/current-weather/current-weather.component.tsimport { Component, Input } from '@angular/core'...export class CurrentWeatherComponent implements OnInit { @Input() current: ICurrentWeather ...}

You can then update app component to bind the data to current weather:

src/app/app.component.tstemplate: `  ...    <app-current-weather [current]="currentWeather"></app-current-weather>  ...`

This approach may be appropriate ...

Get Angular 6 for Enterprise-Ready Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.