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
πŸ—£ All Ukrainians are grateful to the Malian rebels for the work they have done. Nothing can stop the idea whose time has come.

Glory to Heroes.
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘10πŸ‘Ž1
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ’’ Interview Questions: Event loop mechanism

#js #interview #eventLoop

Question: Give an explanatory note on the event loop mechanism.

answer:

The event loop mechanism mainly has the following processes:

πŸ‰Synchronous tasks are executed on the main thread, forming an execution context stack.

πŸ“Once all synchronous tasks in the execution stack have been executed, the system will read the asynchronous tasks in the queue, such as Promise.then(), setTimeout, AJAX callbacks, etc.

πŸ†The asynchronous task will be added to the task queue

πŸ₯‘Once the execution stack is cleared, the system checks the task queue. If it is not empty, the first task is taken out and placed on the execution stack for execution.

πŸ₯¦The main thread repeats the process of alternating execution of the stack and queue, thereby realizing queued execution of threads.
The event loop allows synchronous tasks and asynchronous tasks to be executed alternately in the same thread, making full use of CPU resources. This is important for JavaScript that supports UI interaction and responsiveness.
Please open Telegram to view this post
VIEW IN TELEGRAM
❀1πŸ‘1
πŸ’΅ FOR Ukraine:
πŸ”— https://send.monobank.ua/jar/6DbLp37hre
πŸ’³ 5375 4112 1187 1350

🌎 FOR ALL DONATS:

πŸ’΅ PayPal: luckystudydanit@gmail.com
πŸ’΅ SWIFT code: UNJSUAUKXXX

My profile with reports after closing fundraiser :
https://www.facebook.com/volunt2erua/

also all reports in our πŸš€ channel:
https://t.me/toxicc_squad
Please open Telegram to view this post
VIEW IN TELEGRAM
❀3
🚳 Interview Questions: Ajax implementation

#js #interview #ajax

Implement an ajax request function that supports Promise:

🍣Send a request using the XMLHttpRequest object

πŸ›Initialize the open method, configure the request method and url

🍷Add onload and onerror callback functions

πŸ§‰onload determines whether the status code is within the range of 200–300 resolve, otherwise reject

🫘onerror directly reject

πŸ₯§After the request is successful, resolve returns response, and after failure, reject reports an error.

πŸ₯ŸSupport options to configure request parameters and request body

🍱Returns a Promise object, which can be processed externally using then/catch

Analysis: Promise is used to encapsulate asynchronous ajax requests and achieve a synchronous programming style.
Please open Telegram to view this post
VIEW IN TELEGRAM
🩷 How to avoid subjects and middle services between different components

#angular #signals #inject #guide

On the first screen, we have a ParentComponent that passes data to a ChildComponent, which in turn passes the data to an InnerChildComponent. This is a simple example.

On the second screen, the example will help you to remove prop drilling from your Angular applications and make your code more maintainable and easier to understand.


βœ… Article link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
🚳 Interview Questions: JSONP cross-domain implementation

#js #interview #jsonp

Analysis: Create the script node script.src, set the callback function callbackName, parse the parameters and splice the URL, dynamically insert it into the body to implement JSONP cross-domain request, and return the Promise interface.
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ“΅ Interview Questions: Implement deep cloning

#js #interview #deepClone

Analysis: Recursively implement deep cloning of objects and arrays, returning basic types directly, and reference types recursively call deep cloning hierarchically.
Please open Telegram to view this post
VIEW IN TELEGRAM
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/5TvPibajtR
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
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2
🚱 Interview Questions: Function currying

#js #interview #deepClone #patterns

Analysis: Currying of the add function is achieved by recursively calling a function that continues to accept parameters.
Please open Telegram to view this post
VIEW IN TELEGRAM
❀️ Setting Up Jest in Your Angular Project

#angular #tests #jest #guide

Testing lies at the heart of building robust and reliable Angular applications.


βœ… Article link
🎁 Code link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘1
❀️ 🀍 Global Error Handler β€” Angular

#angular #error #interceptor

⚠️ The example is for presentation purposes only and can be refactored.

βœ… Article link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘1