Problem Statement
What is a component in Angular?
Explanation
A component is the building block of Angular apps. It manages a section of the UI through its logic (TypeScript), view (HTML), and style (CSS). Components are declared with the @Component decorator that defines metadata like selector, template, and styleUrls. Each component controls a part of the screen.
Code Solution
SolutionRead Only
@Component({ selector: 'app-header', templateUrl: './header.html' }) export class HeaderComponent { title = 'Header'; }Practice Sets
This question appears in the following practice sets: