Angular implementation checklist
A technical verification list for deploying enterprise-grade Angular applications, focusing on modern standalone architecture, performance budgets, and RxJS memory safety.
Performance & Bundle Optimization
0/5Enable Production Build Flags
criticalVerify that 'optimization', 'aot', and 'buildOptimizer' are set to true in the production configuration within angular.json.
Configure Bundle Size Budgets
criticalDefine 'budgets' in angular.json for the 'initial' bundle type with a maximum warning of 500kb and error at 1mb to prevent bundle bloat.
Enforce Lazy Loading for Feature Routes
criticalAudit the AppRoutingModule to ensure all top-level feature routes use 'loadComponent' or 'loadChildren' instead of direct imports.
Implement NgOptimizedImage
recommendedReplace all standard <img> tags with the 'NgOptimizedImage' directive and provide 'priority' attributes for LCP elements.
Tree-shake Third-party Libraries
recommendedRun 'source-map-explorer' on the production build to identify and remove unused modules from heavy libraries like Lodash or Moment.js.
Architecture & Modernization
0/5Migrate to Standalone Components
recommendedConvert all components to 'standalone: true' and eliminate 'NgModule' declarations to reduce architectural complexity and improve tree-shaking.
Standardize Dependency Injection
recommendedUse the 'inject()' function in components and services instead of constructor injection for better type inference and cleaner inheritance.
Utilize Angular Signals for Local State
recommendedReplace local 'BehaviorSubject' or 'OnPush' manual triggers with Angular Signals to optimize the change detection cycle and reduce overhead.
Global Service Provisioning
criticalVerify that all singleton services use 'providedIn: root' to ensure they are tree-shakable and correctly scoped for the entire application.
Strict Type Checking
criticalSet 'strict': true in tsconfig.json to enforce null checks and strict property initialization across the codebase.
RxJS & Data Management
0/5Prevent Observable Memory Leaks
criticalEnsure every manual '.subscribe()' call in components is paired with 'takeUntilDestroyed' or an explicit 'unsubscribe' in ngOnDestroy.
Prefer Async Pipe over Manual Subscriptions
criticalAudit templates to use the '| async' pipe for data rendering, delegating subscription management to the framework.
Implement SwitchMap for Race Conditions
recommendedVerify that search and filter inputs use 'switchMap' rather than 'mergeMap' to cancel obsolete HTTP requests during rapid user input.
Define Strong API Interfaces
criticalReplace all instances of 'any' in HttpClient calls with specific TypeScript interfaces representing the backend data contracts.
Centralized Error Handling
criticalImplement a global 'HttpInterceptor' to catch 401, 403, and 500 status codes and route them to a consistent error handling service.
Security & Infrastructure
0/5Sanitize Dynamic HTML
criticalVerify that any content passed to [innerHTML] is processed through Angular's 'DomSanitizer' to prevent XSS attacks.
Configure XSRF Protection
criticalConfigure 'HttpClientXsrfModule' with 'cookieName' and 'headerName' matching the backend's CSRF implementation.
Secure Environment Variables
criticalCheck that environment.prod.ts does not contain hardcoded secrets; use build-time replacement for sensitive API keys.
Route Guard Implementation
criticalApply 'CanActivate' guards to all protected routes to ensure client-side authorization is enforced before component initialization.
Enable Content Security Policy
recommendedAdd a CSP meta tag or header that restricts script execution to trusted domains and prevents inline script execution.
Testing & Quality Assurance
0/5Unit Test Business Logic
recommendedAchieve 80% coverage on services containing complex transformation logic using Jest or Karma.
Critical Path E2E Coverage
criticalImplement Cypress or Playwright tests for the 'Happy Path' of the primary user workflows (e.g., Login, Checkout, Data Submission).
Mock External Dependencies
criticalEnsure all component tests use 'TestBed' to provide mock implementations of services to isolate the unit under test.
Automated Linting Gate
recommendedConfigure 'ng lint' as a required check in the CI/CD pipeline to prevent code style regressions.
Accessibility (A11y) Audit
recommendedRun 'axe-core' or the Angular CDK A11y module to verify that all interactive elements have correct ARIA labels and keyboard focus states.
AI & Integration Patterns
0/5Stream AI Responses
recommendedUtilize RxJS 'fromFetch' or 'EventSource' to handle streaming responses from LLM endpoints to provide real-time UI updates.
AI Loading State UX
recommendedImplement specific 'Signal'-based loading indicators for AI inference tasks to manage user expectations during high-latency operations.
Error Boundaries for AI Services
criticalWrap AI-driven components in error boundaries to ensure that a failure in the LLM service does not crash the entire application shell.
Result Caching Strategy
optionalImplement a caching layer (e.g., in NgRx or a Service) for common AI queries to minimize token costs and improve response times.
UI Distinction for AI Content
optionalApply a specific CSS class or icon to any data generated by AI to comply with transparency requirements for enterprise users.