es
Feedback

¡No caigas en manos de tramposos! Telemetrio encuentra y marca estos canales 👉 Si quieres ver la etiqueta, suscríbete

Angular 🇺🇦 - practical notes

Angular 🇺🇦 - practical notes

Ir al canal en 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!

Mostrar más
1 631
Suscriptores
Sin datos24 horas
+17 días
Sin datos30 días
Archivo de publicaciones
Resize Observable Service in Angular #angular #ResizeObserver ✅ Link: https://stackblitz.com/edit/angular-yobjsn?file=src%2Fa
Resize Observable Service in Angular #angular #ResizeObserver ✅ Link: https://stackblitz.com/edit/angular-yobjsn?file=src%2Fapp%2Fapp.component.ts

Pure CSS navbar #css #target ✅ Link: https://codepen.io/hrtzt/pen/NPZKRN

Directive for Handle Image upload #angular #directive ✅ Link: https://javascript.plainenglish.io/angular-directives-for-handl
Directive for Handle Image upload #angular #directive ✅ Link: https://javascript.plainenglish.io/angular-directives-for-handle-image-upload-c3cefbfbc1a3

js.reduce(): Split array into chunks #js #reduce ✅ Example: function Chunk(array, size) { return array.reduce((acc, _, index)
js.reduce(): Split array into chunks #js #reduce ✅ Example:
function Chunk(array, size) {
  return array.reduce((acc, _, index) => {
    if (index % size === 0) acc.push(array.slice(index, index + size));
    return acc;
  }, []);
}

const numbers = [1, 2, 3, 4, 5, 6, 7];
const arr3 = Chunk(numbers, 2);
// Output: arr3: [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ], [ 7 ] ]

js.reduce(): Deserialize query string #js #reduce ✅ Example: function ParseQueryString(queryString) { return queryString .rep
js.reduce(): Deserialize query string #js #reduce ✅ Example:
function ParseQueryString(queryString) {
  return queryString
    .replace(/(^\?)|(&$)/g, "")
    .split("&")
    .reduce((t, v) => {
      const [key, val] = v.split("=");
      t[key] = decodeURIComponent(val);
      return t;
    }, {});
}

const urlExample = "?name=Bytefer&email=bytefer%40gmail.com";
const queryParam = ParseQueryString(urlExample);
// queryParam: { name: 'Bytefer', email: 'bytefer@gmail.com' }

⚠️ Signals in Angular (new approach of reactivity) #angular #signals 🚩 > Angular 16 ✅ Link: https://medium.com/@simon.sharp_
+4
⚠️ Signals in Angular (new approach of reactivity) #angular #signals 🚩 > Angular 16 ✅ Link: https://medium.com/@simon.sharp_25406/signals-in-angular-3dc2c97ce5a6

js.reduce(): Serialize query parameter object #js #reduce ✅ Example: function StringifyQueryParam(queryParam = {}) { return O
js.reduce(): Serialize query parameter object #js #reduce ✅ Example:
function StringifyQueryParam(queryParam = {}) {
  return Object.entries(queryParam)
    .reduce(
      (t, v) => 
          `${t}${v[0]}=${encodeURIComponent(v[1])}&`,
      Object.keys(queryParam).length ? "?" : ""
    )
    .replace(/&$/, "");
}

const queryString = StringifyQueryParam({
  name: "bytefer",
  email: "bytefer@gmail.com",
});
// queryString: '?name=Bytefer&email=bytefer%40gmail.com'

“Responsive utility” Pipe: BreakpointObserver #angular #cdk #pipe #BreakpointObserver ✅ Link: https://medium.com/@federico.mo
+1
“Responsive utility” Pipe: BreakpointObserver #angular #cdk #pipe #BreakpointObserver ✅ Link: https://medium.com/@federico.monaldi/angular-write-a-responsive-utility-pipe-breakpointobserve-d9051c60cf9c

js.reduce(): Runs an array of promises in series #js #reduce
js.reduce(): Runs an array of promises in series #js #reduce

⚠️ Using Observables as Outputs #angular #directive #output #fromEvent ✅ Link: https://medium.com/ngconf/using-observables-as
⚠️ Using Observables as Outputs #angular #directive #output #fromEvent ✅ Link: https://medium.com/ngconf/using-observables-as-outputs-de40aa167e09

CSS rare functions, properties, and features #css ✅Link: https://stackblitz.com/edit/js-w2yuvk?file=index.html

js.reduce(): Group an array of objects by a specified property #js #reduce ✅ Example: function GroupBy(array, property) { ret
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 } 
//   ]
//  }

⚠️ RequestAnimationFrame instead of setTimeout or setInterval #js #requestAnimationFrame ✅Link: https://javascript.plainengli
⚠️ RequestAnimationFrame instead of setTimeout or setInterval #js #requestAnimationFrame ✅Link: https://javascript.plainenglish.io/speed-up-your-javascript-proven-techniques-for-optimizing-performance-c3471f8df54f