December 2016
Intermediate to advanced
841 pages
17h
English
As a quick recap, the forecast widget will look like this:

What properties does the class need? The template will need forecast data of the current day or the next day. The component can show the weather of Today and Tomorrow, so we will also need a property for that. For fetching the forecast, we also need the location. To show the loading state in the template, we will also store that in the class. This will result in the following class, in lib/forecast.ts:
import { Component, Input } from "angular2/core"; import { ForecastResponse } from "./api"; export interface ForecastData { date: string; temperature: number; ...Read now
Unlock full access