In this video, learn about the template and templateUrl metadata properties for a component and how they are used to add markup to a component render.
- [Instructor] When Angular finds a match There are two options for this; Template or template URL. In the app, and setting to a string value of some markup. and take a look at the run-time results by inspecting the DOM, we can see that the named MW/app has the markup from the metadata inserted inside of it. like a P tag with a description of what the And back in the browser, we can see that our new content is there. Using the template metadata property is an easy way to compose our Angular components. And we can use back ticks around the inline template value here, instead of single quotes, and start moving things to multiple lines for better readability. The other metadata property we can use is the template URL. This property allows us to specify a file that contains the template content. and do the same content rendering. and change the template property to the template URL. So in single quotes, we can use the value ./app.component.html. And one thing to note here is that the relative path can be used here because the bill process set up by the Angular CLI will handle resolving that path for us. Okay, so either template property can be used, its really just a matter of situational needs and personal or team preference.
- 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.