From the course: Angular State Management with NgRx
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Challenge: Use SignalState in our application - Angular Tutorial
From the course: Angular State Management with NgRx
Challenge: Use SignalState in our application
(upbeat music) - In this challenge, you're going to practice a little bit by writing some more NgRx SignalState code for our weather app. In the previous videos, we created a new SignalState to display a list of countries. Now we want to capture the current country selection in our SignalState, and use that selection when the user enters a zip code so we load the weather conditions for a zip code in that selected country. So for instance, let me select the country France. I'm going to type a zip code and add location. And now I'm getting the weather conditions for that zip code in France. And note that you'd have to change the way we call the API. So instead of storing just a zip code in our state, you can store zip code, comma, country code. And that way, when we make the call to the API, as you can see here, we are just going to pass that piece of information as a parameter to the URL, and then the API knows how to get the data for that specific country. So I'll try with one more…