Displaying weather data
In this section, we will create an Angular application to display weather information for a city. The user will enter the name of the city in an input field, and the application will use the OpenWeather API to get weather data for the specified city. We will cover the following topics in more detail:
- Setting up the Angular application
- Communicating with the OpenWeather API
- Displaying weather information for a city
Let's start by creating the Angular application first in the following section.
Setting up the Angular application
We will use the ng new
command of the Angular CLI to create a new Angular application from scratch:
ng new weather-app --style=scss --routing=false
The preceding command will create a new Angular CLI application with the following properties:
weather-app
: The name of the Angular application--style=scss
: Indicates that our Angular application will use the SCSS stylesheet format-...