Angular TutorialLesson 16Free preview
Angular Components
This lesson is part of Angular · All levels
Summary
The component is a TypeScript class with a decorator @Component that describes how a UI part is made. It contains a selector as an HTML marker, a template as a display, as well as properties and methods for logic. A good component focuses on one responsibility only.
Key points
- @Component is a decorator that marks a class as a component
- Selector specifies the name of the component's HTML tag caller
- Template or templateUrl contains a display markup
- Separate business logic to service so the components stay concise
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.