This media is not supported in your browser
VIEW IN TELEGRAM
π€ Smart Change Detection in Angular
#angular #cdr
β Article link: https://medium.com/@jonatan.melzer/smart-change-detection-in-angular-4af3700c2218
#angular #cdr
β Article link: https://medium.com/@jonatan.melzer/smart-change-detection-in-angular-4af3700c2218
π Change Detection in Angular
#angular #signals #cdr
4. Local Change Detection π©Angular 17
β Article link: https://medium.com/ngconf/local-change-detection-in-angular-410d82b38664
#angular #signals #cdr
4. Local Change Detection π©Angular 17
@Component({
selector: 'app-timer',
template: `<span>Last Updated: {{ lastUpdateInSeconds() | number:'1.0-0' }} Seconds</span> {{ logCd() }}`,
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [DatePipe, DecimalPipe, AsyncPipe]
})
export class TimerComponent {
@Input() lastUpdate = new Date();
lastUpdateInSeconds = signal(0)
constructor() {
setInterval(() => {
this.lastUpdateInSeconds.set((new Date().getTime() - this.lastUpdate.getTime()) / 1_000);
}, 1000);
}
logCd() {
console.log('log from timer');
}
}β Article link: https://medium.com/ngconf/local-change-detection-in-angular-410d82b38664
π₯1π₯°1
#angular #cdr #workers
Common Causes of High Memory Usage in Angular
1. Memory Leaks: Components and services not properly cleaned up can cause memory leaks.
2. Excessive DOM Manipulation: Too many DOM elements or frequent updates can increase memory consumption.
3. Large Data Objects in Memory: Keeping large objects or arrays in memory unnecessarily bloats memory usage.
4. Unoptimized Change Detection: Running change detection frequently for all components degrades performance.
5. Improper Use of Observables: Subscriptions that are not unsubscribed can lead to memory leaks.
6. Large Bundle Size: Loading too much JavaScript can impact memory consumption.
β Article Link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
π3