
With Angular 20 now officially out, the updated style guide brings some much-needed clarity and modernization to how we name files and structure projects. If youβre spinning up a new app or considering refactoring a legacy codebase, this breakdown will help you adopt the new conventions confidently.
β File Naming in Angular 20: Simpler, Smarter, Sharper
Angular is finally ditching verbose, redundant file names in favor of cleaner, role-focused naming β and Iβm all for it.
π― Updated Naming Rules:
β No More Suffix Overload
Instead of long, repetitive filenames like user-profile.component.ts
, we now go with:
user-profile.ts
βhighlight.ts
βauth-store.ts
β (replacesauth.service.ts
)
π‘ Note: The word “service” is out β the recommendation is to use domain-oriented or role-based names like *-store.ts
, *-api.ts
, or *-client.ts
.
β Hyphenated Suffixes for Specific Types
For other Angular constructs, suffixes are still useful β but cleaner.
Examples:
auth-guard.ts
(wasauth.guard.ts
)currency-pipe.ts
(wascurrency.pipe.ts
)shared-module.ts
(wasshared.module.ts
)
π§± Project Structure: Domain-Driven & Maintainable
Angular 20 pushes a more scalable, modular approach β goodbye massive features/
folder, hello structure that mirrors how your product works.
π Top-Level Layout
src/
βββ app/
βββ core/ β global, non-business features
βββ domains/ β business-specific features
βββ shared/ β dumb, reusable logic and UI
π core/
β Global Features, Auth, Layout, etc.
This is where you’ll keep things like authentication logic, layout, guards, and global stores.
src/
βββ app/
βββ core/
βββ auth/
β βββ guards/
β β βββ auth-guard.ts
β βββ models/
β β βββ user.model.ts
β βββ stores/
β β βββ auth-store.ts
β βββ auth.routes.ts
β βββ pages/
β βββ login/
β βββ login.ts
β βββ login.html
β βββ login.css
βββ layout/
π‘ Keep pages/
only for routed components. Use models/
, stores/
, and guards/
to stay organized.
πΌ domains/
β Business Logic, Organized by Feature
No more dumping all features into one bucket. Angular 20 encourages organizing around real product domains.
Example for a job board:
src/
βββ app/
βββ domains/
βββ jobs/
β βββ pages/
β β βββ job-list/
β β βββ job-detail/
β βββ models/
β βββ stores/
β βββ services/
β βββ jobs.routes.ts
βββ events/
βββ groups/
β Benefits:
- Keeps concerns separated
- Easier for teams to work independently
- Code is easier to test, scale, and refactor
β»οΈ shared/
β Dumb UI + Reusable Utilities
If a component doesnβt need to know where data comes from, it belongs here.
src/
βββ app/
βββ shared/
βββ components/
β βββ notification/
β βββ notification.ts
β βββ notification.html
β βββ notification.css
βββ pipes/
β βββ format-date-p.ts
βββ utils/
βββ string-utils.ts
π Rule of Thumb: Shared logic is stateless, presentation-focused, and reused across domains.
π Reminder: Angular Is Standalone by Default Now
Since Angular 17, the CLI defaults to Standalone Components β no NgModules needed.
src/
βββ app/
βββ app.ts # Standalone root component
βββ app.routes.ts # Route config
βββ app.config.ts # App-wide setup
This shift reduces boilerplate and makes it easier to adopt a component-first, modular mindset.
π§ Final Thoughts
Angular 20 doesnβt just introduce new features β it encourages you to write cleaner, more intentional code. With simplified naming and a domain-driven project structure, your app becomes:
β
Easier to scale
β
Easier to test
β
Easier to onboard new devs
Whether you’re starting fresh or modernizing an existing codebase, this is the perfect opportunity to align with the latest best practices.
βοΈ Coming Soon:
Follow along for more Angular 20 content, including:
- Advanced usage of Angular Signals
- Migrating legacy projects to standalone components
- Clean state management without NgRx