The @Input decorator allows one-way data flow from a parent to a child component, allowing you to move data from the app component to another component. Learn about this in this video.
- [Instructor] Now that we have our components setup,…we need to figure out how to send the data…that we received into this app component right here,…by using this Http get command,…and pass it along to a sub-component.…We already know how to pass information…from a component to its template,…we do that just by creating a variable…and then giving it some value,…and then we use this expression notation,…these double curly braces,…and just put in the value of the variable here.…So, what we need to do to take care of this…is first create a variable…that we can pass along into the sub-component.…
Now, I'm going to create that variable right here,…and it's going to be called theList.…And I'm going to give it a type of object array,…because the data.json file…happens to be an array of objects.…So, once I do that, then I can go ahead…and use it instead of this console.log.…So I can can say now this.theList is equal to my data.…
That's going to complain because theList is tagged…as an object array, and technically this data…
- 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.