Join our book community on Discord
https://packt.link/EarlyAccess
Sometimes, we need our applications to maintain state between different pages. We can accomplish this by using dependency injection (DI). DI is used to access services that are configured in a central location.
In this chapter, we will create a shopping cart. As we add and delete items from the shopping cart, the application will maintain a list of the items in the shopping cart. The contents of the shopping cart will be retained when we navigate to another page and then return to the page with the shopping cart. Also, the shopping cart's total will be displayed on all the pages.
Application state,dependency injectiona team built on trust!
In this chapter, we will cover the following topics:
- Introducing application state
- Understanding dependency injection
- Creating the shopping cart project