Angular πŸ‡ΊπŸ‡¦ - practical notes
1.63K subscribers
1.6K photos
1 file
532 links
Angular - practical notes

This group is for posting practical notes for Angular developers. Mostly all posts are for quick implementation https://t.me/angular_practical_notes (Commenting on posts only in ENG and UA langs here). Welcome!
Download Telegram
πŸ”΅ Angular Composables 3/3: Async State Example

#signals

βœ… Link: https://medium.com/@stefanoslignos/angular-composables-d0383563a2b3
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘1
πŸ“„ Change Detection in Angular

#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 Signals - Short Example

#angular #signals

βœ… Article link
πŸ‘1
πŸ“„ Declarative way of working with signal effects

#angular #signals #effect

...This approach simplifies the reactive component state management in Angular applications, making the code more declarative and easier to maintain...


βœ… Article link
πŸ‘2
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ“„ Angular Signals: untracked function

#angular #signals #untrackted

untracked allows reading the value of a signal without making such signal a dependency of our computed signal or effect.

In this example, increasing the counter doesn’t trigger a new computation of info. Only a new name does so


name = signal('Angular');
counter = signal(0);

info = computed(
() =>
`The name is now "${this.name()}" and the
counter value was ${untracked(this.counter)} when
the name changed.`
);


🚩 > Angular 17

βœ… Article link
πŸ‘4
πŸ€“ Implementing Two-Way Data Binding

#angular #signals #model

🚩 > Angular 17

βœ… Article link
πŸ“„ How to Replace RxJS with Signals

#angular #rxjs #signals

βœ… Article link
πŸ‘2