Angular › Angular Style Guide & Best Practices
Why does the Angular style guide recommend keeping components small and focused rather than very large?
BeginnerAnswer
Small, focused components are easier to understand at a glance, easier to test in isolation, and easier to reuse in different parts of an app. A very large component that handles too many responsibilities becomes harder to modify safely, since a small change in one part can unexpectedly affect unrelated behavior elsewhere in the same component.
// A large component handling too many unrelated responsibilities
@Component({ selector: 'app-dashboard' })
export class DashboardComponent { /* handles user profile, orders, notifications, and settings */ }
// Broken into smaller, focused components, each with one clear job
<app-user-profile></app-user-profile>
<app-recent-orders></app-recent-orders>
<app-notifications></app-notifications>Real-world example A team refactors a three hundred line dashboard component into four smaller, focused components, each handling just one section, making the codebase much easier for new team members to understand and safely modify.