ngxtension
Why ngxtension? ✨
Section titled “Why ngxtension? ✨”Feature Rich
50+ utilities for modern Angular development
Modern Angular
Built for Angular’s latest features including signals, standalone components, and the new control flow
Performance
Optimized utilities that leverage Angular’s change detection and signals system
Developer Experience
Intuitive APIs that reduce boilerplate and improve code readability
Tree-shakable
Only import what you need, keeping your bundle size minimal
Type-safe
Full TypeScript support with excellent type inference
Focused
Each utility solves a specific problem without unnecessary complexity
Well Documented
Comprehensive documentation with examples and interactive demos
Extensible
Easy to extend and customize for your specific use cases
What does ngxtension offer? 🚀
Section titled “What does ngxtension offer? 🚀”Signal Utilities
Section titled “Signal Utilities”Router Utilities
Section titled “Router Utilities”Injector Utilities
Section titled “Injector Utilities”RxJS Operators
Section titled “RxJS Operators”apply sync/async conditional form validation
controlValueAccessorcreate custom form controlscontrolErrorhandle form control errorsformEventsenhanced form event handlingEffects & Lifecycle
Section titled “Effects & Lifecycle”standalone version of NgRx ComponentStore Effect
effectOnceIfrun effect once when condition is metrxEffectutility to create a side effect with rxjsDirectives
Section titled “Directives”efficient iteration with trackby id or prop
Components
Section titled “Components”collection of Gestures to bind mouse and touch events
Miscellaneous
Section titled “Miscellaneous”lazy create singleton instance of a given class
call/applycall and apply functions safelyintlinternationalization utilitiesmergeHttpContextmerge HTTP context providersQuick Start 🚀
Section titled “Quick Start 🚀”Install ngxtension
Section titled “Install ngxtension”npm install ngxtension# orpnpm add ngxtension# oryarn add ngxtensionImport and use
Section titled “Import and use”Import only what you need. ngxtension is built with tree-shaking in mind.
import { linkedQueryParam, paramToNumber } from 'ngxtension/linked-query-param';import { derivedFrom } from 'ngxtension/derived-from';
@Component({ template: ` <input [(ngModel)]="searchQuery" />
@for (result of results(); track result.id) { <div>{{ result.title }}</div> }
<pagination [(page)]="pageNumber" /> `,})export class MyComponent { readonly searchQuery = linkedQueryParam('search'); readonly pageNumber = linkedQueryParam('page', { parse: paramToNumber({ defaultValue: 1 }), });
readonly results = derivedFrom([this.searchQuery], pipe( switchMap((query) => this.searchService.search(query)), ));}