
Angular is powerful — small habits early on make a big difference later.
Angular is a powerful framework, but many developers struggle with it because of small mistakes made early in a project. These mistakes slowly affect performance, maintainability, and developer experience.
Based on real project experience, here are some common Angular mistakes and how you can avoid them.
1. Not Following a Proper Folder Structure
Many developers put everything inside one folder. Components, services, and models get mixed together. This becomes hard to manage as the app grows.
How to avoid it:
- Organize by feature, not by file type
- Keep each feature in its own folder
- Separate core, shared, and feature modules
- Use an index.ts (barrel) file for clean exports
src/app/
├── core/
│ ├── auth/
│ └── http/
├── shared/
│ ├── ui/
│ └── constants/
└── features/
├── blog/
│ ├── pages/
│ ├── components/
│ ├── services/
│ └── models/
└── projects/
├── pages/
├── components/
└── services/2. Overusing Logic Inside Components
Angular components should handle UI logic only. Many developers add API calls, heavy calculations, and business logic directly inside components.
How to avoid it:
- Move business logic to services
- Keep components simple and readable
- Use services for API calls and shared logic
- Use pure pipes for simple template transformations
// blog.service.ts
@Injectable({ providedIn: 'root' })
export class BlogService {
constructor(private readonly http: HttpClient) {}
getPosts(): Observable<readonly BlogPostDto[]> {
return this.http.get<readonly BlogPostDto[]>('/api/posts');
}
}3. Ignoring Unsubscribing From Observables
One of the most common Angular mistakes is forgetting to unsubscribe from observables. This leads to memory leaks and performance issues.
How to avoid it:
- Use the async pipe when possible
- Unsubscribe manually in ngOnDestroy
- Use operators like takeUntil with a subject
- Use takeUntilDestroyed (Angular 16+)
4. Using Any Type Everywhere
Using any removes the biggest advantage of Angular and TypeScript. It hides errors and makes code unsafe.
How to avoid it:
- Define proper interfaces and models
- Use strict typing
- Avoid any unless absolutely necessary
- Use unknown if the type is truly unknown
5. Poor State Management
Handling state inside multiple components without a plan leads to messy code and bugs.
How to avoid it:
- Use services for shared state
- Use RxJS subjects (BehaviorSubject) wisely
- Use Signals for UI-local state (Angular 16+)
- For large apps, use NgRx or NGXS
6. Not Optimizing Change Detection
Angular apps can become slow if change detection is not handled correctly, especially in large applications.
How to avoid it:
- Use OnPush change detection where possible
- Avoid unnecessary function calls in templates
- Use pure pipes for calculations
- Keep templates clean and simple
7. Skipping Code Reusability
Copy pasting components or logic is a common habit, but it increases bugs and maintenance effort.
How to avoid it:
- Create reusable components
- Use shared modules or standalone components wisely
- Write generic components with Content Projection
- Use Directive for shared behavior
Final Thoughts
Angular is not hard, but it requires discipline. Most problems come from rushed decisions and lack of structure.
If you focus on clean architecture, proper typing, and good practices early, Angular becomes a joy to work with.