Componentsbeginner

Component Architecture Fundamentals

Understand what an Angular component is and why the framework is built around them.

Every Angular application is a tree of components, so understanding what a component actually is — a class decorated with @Component that pairs a TypeScript controller with an HTML template and CSS — is the first thing an interviewer wants to confirm you know. The decorator is not decoration in the cosmetic sense; it attaches metadata that Angular's compiler reads to generate the actual rendering code, wire up change detection, and register the component with the dependency injection system.

A component is like a LEGO brick with a built-in instruction sheet — it knows its own shape (template), color scheme (styles), and how it snaps into place (metadata), so you can combine many of them into something far bigger without redesigning each piece.

Key Concepts

1
The reason components exist as the core building block is composability. A large UI is unmanageable as one giant template, so Angular forces you to break it into small, self-contained pieces that each own their own state, template, and styles, then compose them like HTML tags. This mirrors how the web platform itself works with custom elements, and it is why Angular components map so cleanly onto Web Components when you need interop.
2
Interviewers often probe whether you understand the difference between the component class (behavior), the template (view), and the metadata (configuration) as three distinct concerns that the @Component decorator ties together. They may also ask you to explain selector, template/templateUrl, and styles/styleUrls from memory, since these are the fields you touch on day one and never stop using.
@ComponentselectortemplatetemplateUrlstyles
3
In modern Angular (17+), components are standalone by default, meaning they declare their own imports instead of relying on an enclosing NgModule. This doesn't change what a component fundamentally is, but it does change how you wire dependencies together, which is a frequent follow-up question.