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
JS Performance: Secrets to Reducing DOM Operations πŸš€

✳️ When we change the DOM, the browser must redraw the page, which can be slow and time-consuming. By reducing the number of DOM operations, we can keep page redrawing to a minimum, improving code performance.

#js

βœ… Link: https://medium.com/front-end-weekly/boost-your-javascript-performance-secrets-to-reducing-dom-operations-4160162bd952
Angular theming using Dynamically Load CSS

#angular #theme

⚠️ To see the effect, compile the app with ng build.
β€œstart”: β€œnpm run build && ng serve”


βœ… Link: https://medium.com/@piyalidas.it/angular-theme-integration-using-dynamically-load-css-1617147799bf
js.reduce(): Group an array of objects by a specified property

#js #reduce

βœ… Example:

function GroupBy(array, property) {
return array.reduce((acc, obj) => {
let key = obj[property];
acc[key] = acc[key] || [];
acc[key].push(obj);
return acc;
}, {});
}

const users = [
{ name: "Bytefer", age: 30 },
{ name: "Kakuqo", age: 28 },
{ name: "Chris", age: 28 },
];

const groupedUsers = GroupBy(users, "age");
// groupedUsers:
// {
// '28': [
// { name: 'Kakuqo', age: 28 },
// { name: 'Chris', age: 28 }
// ],
// '30': [
// { name: 'Bytefer', age: 30 }
// ]
// }
πŸ‘1