Angular 🇺🇦 - practical notes
Open in 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!
Show more1 631
Subscribers
No data24 hours
+17 days
No data30 days
Posts Archive
🤓 Angular for Server-Side Rendering (SSR)
#angular #universal #ssr #guide
...Here’s a step-by-step guide to get you started with Server-Side Rendering (SSR) using Angular Universal...✅ Article link
📄 Angular with Electron: Building Cross-Platform Desktop Applications
#angular #electron #guide
Combining Angular with Electron offers a powerful framework for building cross-platform desktop applications. Electron, known for its ability to create desktop applications using web technologies, seamlessly integrates with Angular, a popular front-end framework. This fusion provides developers with a robust platform to build feature-rich desktop applications leveraging their web development skills. In this article, we’ll delve into the integration of Angular with Electron, covering various scenarios and providing detailed code examples.✅ Article link
📄 Angular Named Router Outlets
#angular #router #outlets
<!-- wrapper-layout.component.html -->
<div class="container">
<div class="row">
<div>
<left-side></left-side>
</div>
<div>
<router-outlet
name="showright"
></router-outlet>
</div>
</div>
</div>
/** routing.module.ts */
{
path: 'connect',
component: WrapperLayoutComponent,
children: [
{
path: '',
component: RightSideComponent,
outlet: 'showright'
},
]
},
// component navigation action
this.router.navigate([
'/connect',
{ outlets: { showright: ['user-info'] } }
]);
✅ Article link📄 Real Examples of Promise Patterns
#js #promise
— Promise.all() is ideal when you have multiple asynchronous operations that are independent of each other and need to be performed concurrently. — Promise.race() Use Promise.race() when you need to respond to whichever promise resolves or rejects first. It's useful in scenarios like timeout implementations. — Promise.allSettled() is useful when you need to wait for all promises to settle, regardless of whether they resolve or reject. — Promise.any() returns the first promise that resolves and ignores rejections unless all promises reject.✅ Article link
📄 Customizable Angular animations
#angular #animations #ui_element
...A component with customizable animations might look like this...
// reusable-animation-options.model.ts
export interface IAnimationOptions<V> extends AnimationOptions {
value: StateName
}
// bonus.component.ts
@Component({
animations: [collapse],
host: {
'[@collapse]': 'animationOptions',
},
})
export class BonusComponent implements OnInit {
@Input() public duration = 300;
public options!: IAnimationOptions<string>
public ngOnInit(): void {
this.options = {
value: '_',
params: {
duration: this.duration
},
};
}
}
<!-- bonus.component.ts -->
<!-- durations = [1000, 800, 600, 400, 200, 0] -->
<ng-container
*ngFor="let duration of durations"
>
<app-bonus
*ngIf="state"
[collapseDuration]="duration"
>
<div class="block">
Duration {{duration}} ms
</div>
</app-bonus>
</ng-container>📄 3/3 100+ FREE Resources Every Web Developer Must Try
#frontend #info
FREE Sites for HTML/CSS Templates 🔥
HTML5UP, HTMLRev, Free-CSS, Templated, FreeHTML5, Start, Bootstrap, Bootswatch, BootstrapTaste, Cruip, Tooplate, HTML5xCSS3
Learn CSS by Playing Games 🔥
CSS Diner: Practice CSS selectors with a fun game.
Flexbox Froggy: Learn CSS Flexbox by playing this game.
Grid Garden: Master CSS Grid layout by playing this game.
Flexbox Defense: A game to learn CSS Flexbox.
CSSBattle: Compete against others by writing CSS code.
Flexbox Zombies: Learn CSS Flexbox by playing this game.
FREE Code Editors 🔥
— Visual Studio Code (VS Code)
— Sublime Text
— Brackets
— Vim
JavaScript Animation Libraries 🔥
— Anime.js: Lightweight JavaScript animation library.
— ScrollReveal.js: Easily reveal elements as they enter the viewport.
— Popmotion: A functional, flexible JavaScript motion library.
— AniJS: Declarative handling library for CSS animations.
— Wow.js: Reveal CSS animation as you scroll down a page.
— Typed.js: A JavaScript library that types.
— Velocity.js: Accelerated JavaScript animation.
— GSAP: Professional-grade animation for the modern web.
📄 2/3 100+ FREE Resources Every Web Developer Must Try
#frontend #info
FREE Sites for Vectors, Images, and Illustrations 🔥
— Freepik: Discover free vectors, photos, PSDs, and icons.
— Vecteezy: Find high-quality vector art, graphics, and illustrations.
— Unsplash: Access over a million free high-resolution photos.
— Pixabay: Explore a vast library of free images and videos.
— Flaticon: Download free icons, SVG, PSD, PNG, EPS format, or as ICON FONT.
— Openclipart: Share and use free clipart and images.
— SVGRepo: Download SVGs for free.
— Vectorportal: Free vectors, clip art, and icons.
— SVGBackgrounds: Customizable SVG patterns and backgrounds.
— FreeDesignFile: High-quality graphic design resources.
— Pexels: Find free stock photos and videos shared by talented creators.
— Vectorian: Download royalty-free vector art, stock photos, and stock footage.
FREE Icons for Your Projects 🔥
FontAwesome, Flaticon, Iconfinder, Material Icons, Icons8, BoxIcons, Feather Icons, IcoFont, SVGHUB, Tabler Icons, Iconsmind, Iconmonstr, SVGRepo
FREE Fonts for Your Projects 🔥
Google Fonts,1001FreeFonts, Fontjoy, Fontsly, FontSpace, AbstractFonts, FontZone, DevFonts, DaFont, FontSquirrel, FontFabric
FREE Cheat Sheet Sites🔥
— HTML Cheat Sheet: Quick reference guide for HTML elements and attributes.
— CSS Cheat Sheet: Comprehensive guide to CSS properties and selectors.
— JavaScript Cheat Sheet: Handy reference for JavaScript syntax and concepts.
— Git Cheat Sheet: Essential commands and workflows for Git.
— Markdown Cheat Sheet: Markdown syntax guide for creating rich text formatting.
— React Cheat Sheet: Quick overview of React concepts and syntax.
— Learn x in y minutes: Concise tutorials to learn various programming languages and tools quickly.
— SQL Cheat Sheet: Comprehensive SQL commands and queries reference.
— OverAPI: Collection of cheat sheets for various programming languages and frameworks.
📄 1/3 100+ FREE Resources Every Web Developer Must Try
#frontend #info
FREE Resources to Learn Web Development 🔥
Websites: freeCodeCamp, MDN Web Docs, W3Schools, Scrimba, Codecademy, TheOdinProject, Frontend Mentor, Javascript30, Coursera, Khan Academy
YouTube Channels: Traversy Media, The Net Ninja, Code with Harry (Hindi), Web Dev Simplified, Coder Coder, The Coding Train, FreeCodeCamp
FREE Hosting Platforms for Your Websites 🔥
— Netlify: Deploy your web projects with ease.
— Render: Host web applications and static sites effortlessly.
— GitHub Pages: Host your static websites directly from your GitHub repository.
— Firebase Hosting: Scale your web apps effortlessly with Firebase.
— Vercel: Deploy websites and applications with automatic deployments.
— Cyclic.sh: Host your static sites with zero configuration.
— Appwrite: Open-source backend server for web and mobile developers.
— Supabase: Build modern apps with a scalable backend.
— InfinityFree: Free and unlimited web hosting with PHP, MySQL, and more.
— Surge: Static web publishing for front-end developers.
FREE APIs for Your Projects 🔥
— OpenWeatherMap API: Access current weather data for any location.
— News API: Retrieve live news articles from various sources.
— REST Countries API: Get information about countries worldwide.
— Chuck Norris Jokes API: Lighten up your projects with Chuck Norris jokes.
— Open Food Facts API: Access food product information and ingredients.
— Reddit API: Fetch Reddit data, including posts and comments.
— OneDrive API: Manage files and folders on Microsoft OneDrive.
— Dogs API: Bring adorable dog images and information to your projects.
— GIPHY API: Integrate GIFs and stickers into your applications.
— OMDb API: Access a database of movies and TV shows.
— VirusTotal API: Analyze suspicious files and URLs for malware.
— PokeAPI: Retrieve Pokémon data for your gaming-related projects.
— NASA API: Access a wealth of NASA data, including imagery and information.
📄 Permission/Role-based Security
#angular #guard #guide
No matter what client application you are working with, the following are the five ingredients that are needed to implement permission-based security:
1 — Client-side API Resource
2 — Client Side Session Service
3 — Fall-back Route
4 — Navigation Guards
5 — Fragment Guards
✅ Article link
📄 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
📄 Saga Pattern Guide in Microservices with Node.js
#nodejs #guide #pattern
The Saga pattern addresses this by breaking a transaction into smaller, local transactions handled by different services.There are 2 approaches to implementing the Saga pattern: Choreography-Based Saga and Orchestration-Based Saga.
— Orchestration-Based Saga: A single orchestrator (arranger) manages all the transactions and directs services to execute local transactions. — Choreography-Based Saga: All the services that are part of the distributed transaction publish a new event after completing their local transaction.Choreography-Based Saga approach and a real-world hotel room reservation scenario with 3 microservices: Booking Service, Payment Service, and Notification Service.
— Booking Service: Starts the process by reserving a room. This is the first local transaction. Once successful, it sends a message to the Payment Service to process the payment. — Payment Service: Receives the message and processes the payment. If the payment is successful, it commits its local transaction and informs the Booking Service and Notification Service. — Notification Service: On receiving confirmation of successful payment, it sends a booking confirmation email to the user. — Handling Failures: If the Payment Service encounters an issue (e.g., payment decline), it returns a failure message to the Booking Service. The Booking Service then executes a compensating transaction to cancel the room reservation, ensuring the system returns to its original consistent state.Prerequisites
— Node.js project with necessary dependencies (express, amqplib, nodemailer, mongoose, dotenv) installed. — RabbitMQ server running locally or remotely. — Email server or service for the Notification Service (e.g., Nodemailer with SMTP or an email API service).✅ Article link
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/AgppwxhwLX
5375 4114 1222 8582
🌎 FOR ALL DONATS:
💵 SWIFT code: UNJSUAUKXXX
💵 PayPal: luckystudydanit@gmail.com
My profile with reports after closing fundraiser :
https://www.facebook.com/volunt2erua/
also all reports in our 🚀 channel:
https://t.me/toxicc_squad
📄 New Signal Input API
#angular #signals #input
🚩 > Angular 17.1
✅ Article link
📄 Simple Unsaved Data Changes Guard in Angular 17+
#angular #guard #ui_element
...when a user wants to navigate to other routes having pending data changes in the current page...✅ Article link
📄 Angular’s GoF patterns. Factory Method.
#angular #patterns
Advantages:
— Flexibility and expandability: Allows for easy introduction of new types of products without changing existing code. — Reducing dependencies: The Factory Method reduces the direct dependency between classes that create and use objects, making code modification and testing simpler. — Ease of maintenance and updates: Code using the pattern is easier to maintain and update, as adding a new type of product often doesn’t require changes to the existing code that uses the factory.
Disadvantages:
— Complex architecture: Using Factory Method can complicate application architecture, especially when used unnecessarily or in simple scenarios. — Code bloat: Creating many factory methods and classes can overload the code, making it hard to understand, particularly for new developers. — Performance issues: In some cases, particularly with incorrect implementation, Factory Method can affect application performance due to additional method calls and object creations. — Debugging difficulty: Following this pattern can make debugging harder since the actual object creation is hidden within the factory method, complicating error tracking. — Need for careful planning: Effective use of Factory Method requires detailed planning and understanding of when and what objects should be created. Planning errors can lead to incorrect or excessive implementation. — Limited flexibility in some scenarios: While Factory Method provides flexibility in object creation, it can be limited in scenarios requiring very dynamic or conditional object creation. — Not suitable for simple applications: For small or simple applications with a relatively static structure, using Factory Method might be unnecessary and complicate the project.✅ Article link
📄 Master Angular 17.1 and 17.2
#angular #ngOptimizedImage
🎯Changes and new features In this article, I list out the most important changes and new features, also share resources that will teach you how these new Angular features work: — Model signal inputs — View queries and component queries as signals — ngOptimizedImage: Automatic placeholders — ngOptimizedImage: Netlify image loader support — Angular CLI: clearScreen option support — Angular CLI: define option for declaring global identifiers✅ Article link
📄
@switch vs ngSwitch — Angular 17: The newest version of Angular
#angular #switch #ngSwitch
✅ Article link📄 JavaScript — What’s new with ECMAScript® 2024 (ES15)
#js #es2024
....According to the ECMAScript 2024 Internationalization API Specification (ECMA-402 11th Edition) several features are slated for inclusion in ES2024....🧪 Remember, the pipeline operator is still in “Draft”, Stage 2 of TC39. 🧪 Records and Tuples in Stage 2 of proposal and not yet implemented in JavaScript engines (use Babel). 🧪 Realm in Stage 3 of proposal and not yet implemented.
🗣 I don’t know why the author included non-working features in the article, but I left them in the post just FYI✅ Article link
