In order to manage the display of your records while being able to change them, you need to create an alternate array to hold your display data. Learn how to do that in this video.
- [Instructor] Our application is working pretty well,…and it's responsive to searches, but there's a few problems…that we need to clean up, and the main one is…that if we do a search like this,…and then we delete the query terms, the list here…will never go back to its original state.…And that's because on this line on app component dot ts,…we are always modifying the original list.…So once a list has been filtered to contain…only the elements that match our query, it can never…go back and be what it used to be.…
So what we need to do is create a temporary variable here,…so I'm going to also delete this title,…'cause we don't really need that any more,…and I'll call it modified list.…It's also going to be sort of a clone of the original list,…and I'll go all the way to the bottom and make sure…that when I load the data, I load it…into both of those objects.…And so now what I'll do is when I search for something,…instead of modifying the list, I'm going to modify…the copy of the list, so this modified list…is what's going to change, and now the query's…
- Building custom Angular projects
- Working with subcomponents
- Adding icons
- Adding search functionality
- Using lifecycle methods
- Managing list data
- Indexing your data
- Updating records
Skill Level Intermediate
Using the exercise files1m 43s
1. Building Custom Angular Projects
2. Working with Subcomponents
3. Creating More Subcomponents
Managing form submission8m 33s
4. Managing List Data
Next steps1m 8s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.