In this video, learn how to use the selector metadata property for a component and how it can be used to tell Angular what DOM to apply the component to.
- [Instructor] Angular will use the selector property … from the component metadata to find a match in the DOM, … based on an element name. … If we take a look at the AppComponent, … we can see that it has a selector … with a value of app-root. … And if we flip over to our index.html file, … we can see that we have a DOM element named app-root. … As we learned in an earlier lesson, … over in the main.ts file, … Angular kicks off with the bootstrap call … that takes in an Angular root module. … And in the app.module.ts file, … that contains a list of components to use … as the starting component. … So with the markup we have in the index.html file, … to look over the initial DOM on the page, … and find the first match. … and applies the AppComponent to that element. … The bootstrap function will only load the component … on the first match it finds. … It will not bootstrap multiple instances … of the same component type. … But what if you wanted to use … a different custom element name value, …
- What is Angular?
- Working with components
- Binding events and properties
- Getting data to components
- Using directives and pipes
- Creating Angular forms
- Validating form data
- How Angular does dependency injection
- Making HTTP calls
- Styling components
Skill Level Intermediate
Angular: Building an Interfacewith Ray Villalobos2h 20m Intermediate
1. Architecture Overview
3. Directives and Pipes
5. Dependency Injection and Services
8. Styling Components
Next steps1m 20s
- 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.