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
Factory async function with ability of cancelling

#js #promise #AbortController

function asyncWithAbort(promiseFn, signal){
if (signal?.aborted){
return Promise.reject(new DOMException("Aborted", "AbortError"));
}
return new Promise((resolve, reject) => {
promiseFn().then(resovle).catch(reject);

signal?.addEventListener("abort", () => {
reject(new DOMException("Aborted", "AbortError"));
});
});
}

βœ… Link: https://javascript.plainenglish.io/best-practices-for-using-abortcontroller-87892b72d07e
withComponentInputBinding in Angular

Angular v16 has introduced a powerful new feature that enables the automatic binding of router information, such as query parameters, path parameters, static data, and resolver data to a routed component’s inputs.

#angular #routing #withComponentInputBinding

🚩 > Angular 16

βœ… Link: https://netbasal.com/binding-router-information-to-routed-component-inputs-in-angular-78ee92f63e64
TypeScript 5.0 Decorators

πŸ“„ The TypeScript 5.0 release, officially supports the Phase 3 decorator proposal. The proposal has four stages, which means it stabilizes quickly without major changes to the API. In this article, we will explore based on these stable APIs.

#typescript #decorators

βœ… Link: https://medium.com/@islizeqiang/a-quick-guide-to-typescript-5-0-decorators-d06cabe09e8c