Exercise
Module Exercise
Get the project source code below, and follow along with the lesson material.
Download Project Source CodeTo set up the project on your local machine, please follow the directions provided in the README.md
file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.
Lesson Transcript
[00:00 - 00:21] What is exercise? When the user gets the thank you page, what I want you to do is when the user clicks on the continue shopping button, I want them to get navigated back to the landing page, but I want the entire state of the signals to get cleared.
[00:22 - 00:36] What do I mean by this? I want you to reset the entire state of the application back to zero, like we have an MCRA in a local storage as well as an MC object in a signal.
[00:37 - 01:15] To give you int on how to go about this, all you need to do is switch to the product service file, create a new method called remove all items from that, and then within this auction, you can make repairs to the signal that holds the entire items in a shopping cart, which is cart items, and then make use of the updates method to reset the entire array to MC. Once you are done with this, right below this method, you can just also reset the state of the local storage to MC by passing in an MCRA.
[01:16 - 01:30] Then in the thank you component, all you need to do is to create a button as well as a router that navigates the user back to the landing page once these conditions are met. So that's the exercise for this particular module.
[01:31 - 01:47] If you have any issues implementing this, feel free to reach out to me in the discord channel, and I'm going to provide more insights on how you can achieve this. And if you're able to do it successfully, please let me know in the discord channel, the link will be provided for you in this course.
[01:48 - 01:50] Now with that, we can move to the next lesson in this module.
This lesson preview is part of the Demystifying Reactivity with Angular Signals course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.
Get unlimited access to Demystifying Reactivity with Angular Signals, plus 70+ \newline books, guides and courses with the \newline Pro subscription.
![Thumbnail for the \newline course Demystifying Reactivity with Angular Signals](/_next/image?url=https%3A%2F%2Fs3.amazonaws.com%2Fassets.fullstack.io%2Fn%2F20240123162152189_DejiAdesoga_DemystifyingReactivitywithAngularSignals_1450.67x816_CoverImage.png&w=3840&q=75)