November 2019
Beginner
804 pages
20h 1m
English
This method will be used by the controller to retrieve the form selections.
Add the definition of the method as follows:
getChartFormDetails(): { error?: string; countryId?: string; indicator?: string; fromYear?: number; toYear?: number, chartType?: string } {
// Continue here
}
As stated before, notice the return type again. We reuse the same trick as in the previous chapter, by defining a custom type including an optional error. Then, we check the different form fields and report back to the user when something is invalid.
Read now
Unlock full access