Angular πΊπ¦ - practical notes
ΠΡΠΊΡΡΡΡ Π² Telegram
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!
ΠΠΎΠ»ΡΡΠ΅1 631
ΠΠΎΠ΄ΠΏΠΈΡΡΠΈΠΊΠΈ
ΠΠ΅Ρ Π΄Π°Π½Π½ΡΡ
24 ΡΠ°ΡΠ°
+17 Π΄Π½Π΅ΠΉ
ΠΠ΅Ρ Π΄Π°Π½Π½ΡΡ
30 Π΄Π½Π΅ΠΉ
ΠΡΡ
ΠΈΠ² ΠΏΠΎΡΡΠΎΠ²
+1
π Angular : Best practices after the renaissance #1
#angular #controlFlow
Control flow (from version β₯ 17) One of the biggest improvements in Angular is the introduction of new syntax for handling HTML. The updated syntax for managing conditions and iterations significantly enhances code clarity and maintainability. Previously, directives like *ngIf and *ngFor were used, but the new syntax offers more streamlined and cleaner ways to handle such scenarios.
+1
π― Magic of Generators
#js #generators
Generators: Advantages β Fine-Grained Control: Generators give you the ability to pause and resume function execution at will. This can be a game-changer in scenarios like lazy evaluation, custom iteration logic, or complex control flows. β Memory Efficiency: Since generators produce values on demand, they are highly memory-efficient, making them perfect for handling large datasets or streams. β Readable Asynchronous Code: While async/await has largely supplanted many asynchronous handling methods, generators still offer a unique combination of readability and control, making complex asynchronous flows easier to manage.β Article link
+4
β€οΈ OAuth2 Integration with Angular 18
#angular #OAuth2 #guide
OAuth2 is a popular authorization framework that allows third-party services to authenticate users without sharing credentials. Itβs a powerful protocol for securing Angular applications by delegating authentication and authorization to a trusted identity provider like Google, Facebook, or your own backend server.β Article link
+1
π Angular: Go Zoneless
#angular #ngZone #zoneless
Why Zoneless? Well, isn't it clear after those pictures? β¦In my opinion it might look clear, but this isn't the only advantage, there are others: β Better performance: ZoneJS uses async task as indicators for change. It doesn't directly know when and where exactly the change has happened. You can imagine that it is a system that always runs and is checking everything, everywhere with some exceptions such as OnPush strategy etc. β Debugging: We all know the Expression Changed After Checked we've all been there. Now the stack trace and errors will be more straight forward. β Better feeling from the app: I haven't found the right words, but it just feel better. It feel better that when you change a property with async/await or using .signal(). Then the change appears immediately in the correct spot. β Zone.js was the reason not to develop an App in Angular: Imagine you were building a snippet that was checking user interaction. For example you wanted to calculate how many times is user performing some event such as clicking, touching or interacting with keyboard -> in such scenario your app would go crazy with Angular and you would have to have a lot of components running out of Zone and manually trigger change detection. Otherwise your app even with OnPush strategy could freeze.β Article link
+3
π©΅ Preloading Strategies in Angular
#angular #preload #preloading #PreloadingStrategy
Angular comes with two built-in preloading strategies: β NoPreloading (default): Disables preloading entirely. Lazy-loaded modules are only fetched when the user navigates to them. β PreloadAllModules: Preloads all lazy-loaded modules in the background after the initial app load. This is ideal for smaller applications with limited routes, where preloading everything wonβt overwhelm the network. β Custom Preloading Strategies: Taking Control of Performance Angular allows you to define custom preloading strategies to preload specific routes based on your appβs requirements. This gives you fine-grained control over which modules should be loaded in the background and under what conditions.β Article link
+2
π³ JavaScript Design Pattern: Builder
#js #patterns #ui_element
β
Article link
+5
π΅ JavaScript Promises: 8 Practical Use Cases
#js #promise
β
Article link
+9
π CSS New Features
#css #guide #info
This is a list of the new changes (more details below): β Changes to attr() function: so it can be used with any attribute and in any CSS property (not only on content). β calc-size() function: use intrinsic values such as auto or min-content in calculations. β New first-valid() function to avoid issues with custom properties with invalid values. β New *-mix() family of functions with a new notation for ratios. β New *-progress() family of functions to calculate the progress ratio between a range or within a media or container. β Randomization with new random() and random-item() functions, to return random values from a range or list (finally!) β New sibling-count() and sibling-index() functions that provide integer values to operate depending on the order and size. β New toggle() function for styling nested elements easily cycling over a list of values. β New functional notation for arguments with comma-separated lists of values, to avoid ambiguity with the comma separating the arguments. β New URL modifiers to provide more control over url() requests. β Extension of the position type to allow flow-relative values.β Article link
Repost from Angular πΊπ¦ - practical notes
Hello, friends!
As you can see, I'm a Ukrainian software engineer who tries to do volunteer fundraisers to support the Armed Forces of Ukraine. Sometimes it takes a lot of time and I am not able to maintain this channel for you. Please help me close these fundraisers because without the Ukrainian army there will be nothing Ukrainian. Thank you very much!
π΅ FOR Ukraine:
https://send.monobank.ua/jar/3Xo6msrUCg
5375 4112 2361 3253
π FOR ALL DONATS:
π² PayPal: timohin@ua.fm
π΅ SWIFT code: UNJSUAUKXXX
also all reports in my channels:
π Π’Π Π·Π²ΡΡΠΈ | π Facebook |πΉ YouTube
β€οΈ Custom Dynamic Module Loader
#angular #dynamic
Places Where We Can Use Dynamic Module Loading β Micro-Frontends: When integrating multiple micro-frontends, each built with different versions of Angular or other frameworks, dynamic module loading can help load and compile modules based on the frontend in use. β Third-Party Integrations: If your application needs to integrate third-party Angular libraries or components dynamically at runtime, dynamic loading can optimize their performance and only include the necessary code. β Role-Based Access Control (RBAC): Dynamic module loading is excellent for conditionally loading parts of the application based on the userβs role or permissions. You can securely avoid loading unnecessary modules for users with restricted access.β Article link
+3
βοΈ Multicasting in Angular
#angular #rxjs #share #publish #shareReplay
What is Multicasting? Multicasting allows an observable to share its execution across multiple subscribers, so that all subscribers receive the same emitted data at the same time. By default, observables in RxJS are βunicast,β meaning each subscription creates a separate execution of the observable. This can lead to multiple API calls or side effects if several components subscribe to the same observable. Multicasting ensures that only one execution occurs, regardless of how many subscribers are attached to the observable. This is particularly useful in scenarios where expensive operations (such as HTTP requests) should be shared across multiple components without being re-executed multiple times.β Article link
+9
π€β€οΈ 10 Commonly Made Coding Mistakes in Angular
#angular #guide #info
β
Article link
+7
π΅ Most desired JS features in the following ES XX specifications
#js #esnext
β
Article link
+1
π΅ How To Cancel A Promise In Vanilla JavaScript?π€
#js #promise
β
Article link
+6
π΅ JavaScript Design Pattern β Facade
#js #patterns
β
Article link
+9
π β Angular vs. React: Comparison for Front-End Developers
#angular #react #info
Before we start the comparison, letβs briefly define Angular and React: - Angular: A full-fledged front-end framework developed and maintained by Google. It is a complete solution for building large-scale applications, offering built-in tools for everything from routing to state management. - React: A JavaScript library created by Facebook for building UI components. Unlike Angular, React focuses on the view layer only, offering flexibility to developers by allowing them to choose other libraries and tools for state management, routing, and more.β Article link
+7
π A Scalable CSS Architecture for Modern Web Applications
#css #info #guide
The Core Challenge of Scaling CSS As applications evolve, managing styling consistently becomes even harder. Web projects often face issues like: β Inconsistent UI elements: Without a unified system, different pages or features can drift apart visually. β Hard-to-maintain styles: Styling becomes scattered and unorganized, making future changes tedious and error-prone. β Difficulty in updating themes or branding: Modifying a color or spacing may involve updating hundreds of individual styles.β Article link
+5
π π€ `CanMatch` Interface in Angular Router (2024)
#angular #guard #router #routing
The CanMatch interface is a part of Angularβs routing mechanism that enables conditional route matching. It provides a way to define guard logic that runs before the router tries to activate a route. If all CanMatch guards return true, the router proceeds with navigation to the route. If any guard returns false, the route is skipped for matching, and the router evaluates other route configurations.β Article link
π π€ `CanMatch` Interface in Angular Router (2024)
#angular #router
