Latest
Modern Angular Development
Angular Modern This document provides comprehensive guidelines for angular modern development and best practices. Component Development OnPush OnPush change detection strategy Implement proper onpush change detection strategy Follow best practices for optimal results Input/Output Input/Output decorators for communication Implement proper input/output decorators for communication Follow best practices for optimal results ViewChild ViewChild and ContentChild for DOM access Implement proper viewchild and contentchild for dom access Follow best practices for optimal results Lifecycle Lifecycle hooks implementation Implement proper lifecycle hooks implementation Follow best practices for optimal results Reactive Reactive forms with FormBuilder Implement proper reactive forms with formbuilder Follow best practices for optimal results Routing & Navigation Angular Angular Router with lazy loading Implement proper angular router with lazy loading Follow best practices for optimal results Route Route guards for authentication Implement proper route guards for authentication Follow best practices for optimal results Resolver Resolver for data preloading Implement proper resolver for data preloading Follow best practices for optimal results Nested Nested routes and child components Implement proper nested routes and child components Follow best practices for optimal results Route Route parameters and query strings Implement proper route parameters and query strings Follow best practices for optimal results Forms & Validation Reactive Reactive forms with FormGroup/FormControl Implement proper reactive forms with formgroup/formcontrol Follow best practices for optimal results Custom Custom validators Implement proper custom validators Follow best practices for optimal results Cross-field Cross-field validation Implement proper cross-field validation Follow best practices for optimal results Dynamic Dynamic form generation Implement proper dynamic form generation Follow best practices for optimal results Async Async validation Implement proper async validation Follow best practices for optimal results Performance Optimization OnPush OnPush change detection Implement proper onpush change detection Follow best practices for optimal results Lazy Lazy loading modules and components Implement proper lazy loading modules and components Follow best practices for optimal results Tree Tree shaking and bundle optimization Implement proper tree shaking and bundle optimization Follow best practices for optimal results Image Image optimization with NgOptimizedImage Implement proper image optimization with ngoptimizedimage Follow best practices for optimal results Virtual Virtual scrolling for large lists Implement proper virtual scrolling for large lists Follow best practices for optimal results Build & Deployment Angular Angular CLI for project management Implement proper angular cli for project management Follow best practices for optimal results Environment Environment configurations Implement proper environment configurations Follow best practices for optimal results Bundle Bundle analysis and optimization Implement proper bundle analysis and optimization Follow best practices for optimal results PWA PWA features with service workers Implement proper pwa features with service workers Follow best practices for optimal results Docker Docker containerization Implement proper docker containerization Follow best practices for optimal results Summary Checklist [ ] Core principles implemented [ ] Best practices followed [ ] Performance optimized [ ] Security measures in place [ ] Testing strategy implemented [ ] Documentation completed [ ] Monitoring configured [ ] Production deployment ready Follow these comprehensive guidelines for successful angular modern implementation.
Angular Standalone Components
Angular Standalone Components Best Practices Comprehensive guide for building modern Angular applications with standalone components, signals, and the latest Angular patterns. Modern Template Syntax Control Flow with @if, @for, @switch Use new control flow syntax instead of structural directives Implement proper track functions for @for loops Handle empty states and loading conditions Example control flow patterns: Reactive Forms with Signals Integrate reactive forms with signal-based state Implement form validation with signals Handle form submission and errors Example form integration: Routing and Navigation Functional Route Guards Use functional guards instead of class-based guards Implement route protection with signals Handle navigation state reactively Example functional guards: Lazy Loading with Standalone Components Implement route-level code splitting Load components and features on demand Optimize bundle size with lazy loading Example lazy loading setup: Summary Checklist [ ] Use standalone components to eliminate NgModule boilerplate [ ] Leverage inject() function for dependency injection [ ] Implement signals for reactive state management [ ] Use new control flow syntax (@if, @for, @switch) [ ] Create computed signals for derived state [ ] Implement functional route guards and resolvers [ ] Use lazy loading for optimal bundle size [ ] Write comprehensive tests for components and services [ ] Handle form state with reactive forms and signals [ ] Implement proper error handling and loading states [ ] Use signal inputs and function outputs for component communication [ ] Create reactive services with signal-based state Follow these patterns to build modern, performant Angular applications using standalone components and the latest Angular features.
Browse Cursor Rules - Cursor IDE Community Prompts & Configurations