Skip to content

Commit a64ddee

Browse files
committed
docs(ngx-utils): Add introduction page for Angular utilities package documentation -- closes #312
1 parent 17e3b97 commit a64ddee

File tree

1 file changed

+121
-0
lines changed
  • apps/docs/src/app/pages/docs/angular/utils/introduction

1 file changed

+121
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
keyword: IntroductionPage
3+
---
4+
5+
`ngx-utils` is an Angular based package providing a wide array of common utilities and solutions.
6+
7+
## For organisations
8+
9+
In modern web applications, developers often face recurring challenges in handling user interactions, data transformations, and accessibility requirements. Our utilities package aims to provide solutions to both common and complex use-cases, enhancing both the user and developer experience!
10+
11+
By providing a comprehensive set of tested and accessible utilities, we ensure that your development team can focus on building features rather than reimplementing common patterns. Our utilities handle everything from data formatting to complex form synchronization, all while maintaining WCAG/ARIA compliance where applicable.
12+
13+
We also aim to enhance application performance through SSR-safe implementations and optimized data handling. Our storage solutions, media queries, and DOM manipulations are designed to work seamlessly in both server-side and client-side environments, ensuring your application remains fast and responsive.
14+
15+
Our package helps organisations by providing:
16+
17+
- **Development Speed**: Ready-to-use solutions for common challenges, reducing development time
18+
- **Code Quality**: Tested and maintained utilities that ensure reliable functionality
19+
- **Accessibility**: WCAG/ARIA compliant components and utilities out of the box
20+
- **Performance**: SSR-safe implementations and optimized data handling
21+
- **Maintainability**: Standardized solutions that are easier to maintain and update
22+
- **Flexibility**: Independent utilities that can be used as needed
23+
24+
Looking for more information on how this package can help you out in your application? Mail us at [[email protected]](mailto:[email protected])
25+
26+
## For developers
27+
28+
The `ngx-utils` package provides a rich collection of utilities to enhance your Angular development experience. Whether you're building a small application or a large-scale enterprise system, our utilities help you write cleaner, more maintainable code.
29+
30+
This package comes with a wide array of:
31+
32+
### Pipes for Data Transformation
33+
34+
- Data transformation (BTW, IBAN formatting)
35+
- Array manipulation (clean, merge, limit)
36+
- Text processing (truncate, strip HTML, highlight)
37+
- Safety utilities (safe HTML, router links)
38+
39+
```typescript
40+
// Format Belgian VAT numbers
41+
{{ '123456789' | btw }} // Output: 123.456.789
42+
43+
// Clean arrays from falsy values
44+
{{ [1, null, 2, undefined, 3] | cleanArray }} // Output: [1, 2, 3]
45+
46+
// Truncate long text
47+
{{ longText | truncate:50 }} // Smart text truncation
48+
49+
// Strip HTML tags
50+
{{ htmlContent | stripHtml }} // Clean text without HTML
51+
```
52+
53+
### Accessibility-Enhanced Directives
54+
55+
- Accessibility enhancements (focus handling)
56+
- User interaction improvements
57+
- DOM manipulation utilities
58+
59+
```typescript
60+
// Focus-click for keyboard navigation
61+
<button focusClick (click)="doSomething()">Click me!</button>
62+
63+
// Combine with other directives
64+
<div focusClick [class.active]="isActive">
65+
Interactive content
66+
</div>
67+
```
68+
69+
### SSR-Safe Services
70+
71+
- Window service (SSR-safe)
72+
- Storage service (Observable-based local/session storage)
73+
- Media query service
74+
- Subscription management
75+
- Broadcast channel service
76+
77+
```typescript
78+
// Window service for SSR safety
79+
constructor(private windowService: NgxWindowService) {
80+
if (this.windowService.isBrowser) {
81+
// Client-side code
82+
}
83+
}
84+
85+
// Observable-based storage service
86+
constructor(private storageService: NgxStorageService) {
87+
// Listen to storage changes
88+
this.storageService.storageEvents$.subscribe(event => {
89+
console.log('Storage changed:', event);
90+
});
91+
92+
// Use local or session storage
93+
this.storageService.localStorage.setItem('key', value);
94+
this.storageService.sessionStorage.getItem('key');
95+
}
96+
97+
// Media query service
98+
constructor(private mediaQueryService: NgxMediaQueryService) {
99+
this.mediaQueryService.register('mobile', '(max-width: 768px)');
100+
this.mediaQueryService.observe('mobile').subscribe(matches => {
101+
this.isMobile = matches;
102+
});
103+
}
104+
```
105+
106+
- **Abstracts**:
107+
- Query parameter form synchronization
108+
- Complex pattern implementations
109+
- Reusable base components
110+
111+
- **Types**:
112+
- Common interface definitions
113+
- Type safety utilities
114+
- Shared type declarations
115+
116+
- **Utils**:
117+
- Change detection helpers
118+
- Common operations
119+
- Performance optimizations
120+
121+
New implementations are added on a regular basis to address emerging development needs and patterns.

0 commit comments

Comments
 (0)