From the course: Angular: Testing and Debugging
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Adding a local storage service - Angular Tutorial
From the course: Angular: Testing and Debugging
Adding a local storage service
- [Instructor] Let's add a feature in our app that lets users save the current filter state. There are many ways we could do this but to keep things simple, I'm going to use local storage. Local storage is one of several client side data storage options available on all modern browsers and it's an excellent choice for our use case here. In local storage, data is stored as simple key value pairs and the data persists between browsing sessions until it's deleted by the user or some trigger in our app code. This means we can restore the filter on page load even after the user closes the browser window. Check out the course managing data in Angular two applications here in our library for an in-depth look at all your data storage options for Angular. I'm in VSA code here and I already installed the NPM packages and launched a local dev server. I'm going to make a new file now using the Angular CLI tool. I'll need a new terminal window, so I'll go to this plus sign here click on it to open…
Contents
-
-
-
-
-
(Locked)
Adding a local storage service4m 38s
-
(Locked)
Fixing dependency injection errors3m 38s
-
(Locked)
Getting and setting data in local storage3m 18s
-
(Locked)
Adding a custom Angular pipe4m 51s
-
Using regular expressions to find content4m 13s
-
(Locked)
Using a pipe to change HTML content4m 17s
-
(Locked)
Common pipe errors1m 53s
-
(Locked)
Understanding Angular decorators2m 6s
-
(Locked)
Challenge: Filter the array of users by locationId30s
-
(Locked)
Solution: Filter the array of users by locationId1m 23s
-
(Locked)
-
-
-
-
-