November 2019
Beginner
804 pages
20h 1m
English
Let's define our contract.
Do the following inside src/views and create a file called world-explorer-view.intf.ts.
Here's the interface definition that we'll use:
import {Country} from "../domain";
import {ChartDetails} from "./chart-details.intf";
export interface WorldExplorerView {
displayErrorMessage(message: string): void;
displayCountries(countries: Country[]): void;
displayYears(years: number[]): void;
getChartFormDetails(): { error?: string, countryId?: string, indicator?: string, fromYear?: number, toYear?: number, chartType?: string};
displayChart(chartDetails: ChartDetails): void;
}
For the return type of the getChartFormDetails method, we are using the same trick as in the last chapter, allowing us ...
Read now
Unlock full access