Anatomy of a component

Every component must have:

  • A TypeScript class with behaviors such as handling user input and fetching data from a server
  • An HTML template that controls what renders into the DOM
  • CSS selector that defines how the component is used in HTML

You provide Angular-specific information for a component by adding a @Component decorator on top of the TypeScript class:

Move to next lesson?

This lesson will not be marked as complete. Continue anyway?

Login to continue

Please login or purchase the course to access this lesson.

Login