#react #mediator
Using the Mediator pattern as a state management solution in React applications also promotes modularization, making it easier to reuse components in other parts of the application or even in other applications.
β Article Link: https://itnext.io/improve-state-management-in-react-with-mediator-design-pattern-db632cbe6475
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
π Implementing Edit-in-Place in Angular
#angular #directive #forms
β Article Link: https://netbasal.com/keeping-it-simple-implementing-edit-in-place-in-angular-4fd92c4dfc70
π Code Link: https://stackblitz.com/edit/stackblitz-starters-1r4vtr?file=src%2Fapp%2Fapp.component.ts
#angular #directive #forms
β Article Link: https://netbasal.com/keeping-it-simple-implementing-edit-in-place-in-angular-4fd92c4dfc70
Please open Telegram to view this post
VIEW IN TELEGRAM
How to install Angular Server-Side Rendering (SSR) with NestJS
#angular #ssr #nestjs
β Article Link: https://medium.com/@pratheeshrussell/an-introduction-to-angular-server-side-rendering-ssr-with-nestjs-c121185d5824
π Code Link: https://github.com/pratheeshrussell/angular-nest-ssr
#angular #ssr #nestjs
β Article Link: https://medium.com/@pratheeshrussell/an-introduction-to-angular-server-side-rendering-ssr-with-nestjs-c121185d5824
Please open Telegram to view this post
VIEW IN TELEGRAM
π
#angular #rxjs #animationFrameScheduler
The
β Article Link: https://priyank-bhardwaj.medium.com/reactive-ninja-harnessing-rxjs-for-angular-mastery-part-2-7091aac29d60
animationFrameScheduler example#angular #rxjs #animationFrameScheduler
animationFrameScheduler is tailored for tasks that require synchronization with the browser's animation frame. It schedules tasks to be executed just before the next animation frame, ensuring smooth animations and minimizing unnecessary computations. For instance, we can utilize the animationFrameScheduler to update the UI based on animation frames, creating a visually pleasing and responsive user interface.The
scrollPosition$ observable captures the scroll position of the window on each scroll event. The animationFrameScheduler is used to ensure that the scroll position updates and smooth scrolling effect occur right before each animation frame, providing a visually smooth scrolling experience. When the user clicks the "scroll to top" button, the scrollPosition$ observable is subscribed to, and the window is scrolled smoothly towards the top in increments of 10 pixels until the scroll position reaches 0.β Article Link: https://priyank-bhardwaj.medium.com/reactive-ninja-harnessing-rxjs-for-angular-mastery-part-2-7091aac29d60
π View PDF in Angular
#angular #pdf #DomSanitizer
How to use?
Put the following code in HTML:
#angular #pdf #DomSanitizer
How to use?
Put the following code in HTML:
<embed [src]="sanitizedUrl | safeResourceUrl | async" class="pdf-content"/>β Article Link: https://itnext.io/you-dont-need-external-packages-to-view-pdf-in-angular-e47779f86595
π Debounce decorator in Angular
#angular #decorator #debounce
β οΈ Third-Party Lib
Usage example:
#angular #decorator #debounce
β οΈ Third-Party Lib
Usage example:
@Component({...})
export class ExampleComponent {
@Debounce(1000)
execute(arg: unknown) {
[ ... ]
}
}
β
Article Link: https://blog.bitsrc.io/3-ways-to-debounce-http-requests-in-angular-c407eb165adaβ€1
π Catch decorator in Angular
#angular #decorator #catch
β Article Link: https://javascript.plainenglish.io/a-try-catch-decorator-to-stylize-your-code-bdd0202765c8
π Code Link: https://github.com/omirobarcelo/catch-decorator/blob/master/src/index.ts
#angular #decorator #catch
β Article Link: https://javascript.plainenglish.io/a-try-catch-decorator-to-stylize-your-code-bdd0202765c8
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
β³οΈ Handle subscriptions directly from template with Init Directive
#angular #directive
The problem is every
β Article Link: https://medium.com/@mikekucherov92/angular-utilities-init-directive-8dc4e0a4723c
π Code Link:
https://gist.github.com/mikekucherov/9677d444148e7f1f8890e0130402b1de#file-init-params-component-html
https://gist.github.com/mikekucherov/84caf26cb387eb904877552531151d1a#file-init-directive-ts
#angular #directive
The problem is every
async pipe usage creates a new subscription which is not what you really want to see in your project. Moreover this approach wonβt work if yourβre dealing with cold observables such as http requests. Because in that case every subscriber will get different value. You might know about as keyword in`ngIf ` to bind a template property of some data and solve the problem of reusing same data multiple times. But what if we donβt want to hide this piece of template in any condition. Or imagine we have a lot of streams, which we need to reuse. That would be a bunch of pointless ngIf directives!β Article Link: https://medium.com/@mikekucherov92/angular-utilities-init-directive-8dc4e0a4723c
https://gist.github.com/mikekucherov/9677d444148e7f1f8890e0130402b1de#file-init-params-component-html
https://gist.github.com/mikekucherov/84caf26cb387eb904877552531151d1a#file-init-directive-ts
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
π2
This media is not supported in your browser
VIEW IN TELEGRAM
β³οΈ Implementing a Loading Skeleton in Angular
#angular #directive #skeleton #ui_element
Skeletons are placeholder elements that are displayed before the actual content is loaded on a webpage. A skeleton is usually a light gray box or circle that you see on websites like Medium, YouTube, etc. Skeletons convey a visual impression of the feature, which gives them an advantage over spinners.
β Article Link: https://netbasal.com/implementing-a-loading-skeleton-in-angular-7490ffdecc1b
π Code Link:
Step 1: https://gist.github.com/NetanelBasal/33f8ec9a106ee2367f3b9847fd3043cb#file-rect-ske-component-ts
Step 2: https://gist.github.com/NetanelBasal/82030b63d6ed0055c09a543483bd3470#file-skeleton-directive-ts
Step 3: https://gist.github.com/NetanelBasal/0f26e85d13d10a9e564541553094c12f#file-skeleton-demo-html
#angular #directive #skeleton #ui_element
Skeletons are placeholder elements that are displayed before the actual content is loaded on a webpage. A skeleton is usually a light gray box or circle that you see on websites like Medium, YouTube, etc. Skeletons convey a visual impression of the feature, which gives them an advantage over spinners.
β Article Link: https://netbasal.com/implementing-a-loading-skeleton-in-angular-7490ffdecc1b
Step 1: https://gist.github.com/NetanelBasal/33f8ec9a106ee2367f3b9847fd3043cb#file-rect-ske-component-ts
Step 2: https://gist.github.com/NetanelBasal/82030b63d6ed0055c09a543483bd3470#file-skeleton-directive-ts
Step 3: https://gist.github.com/NetanelBasal/0f26e85d13d10a9e564541553094c12f#file-skeleton-demo-html
Please open Telegram to view this post
VIEW IN TELEGRAM
π Binding CSS Variables in Angular
#angular #directive #css_variables
β Article Link: https://netbasal.com/binding-css-variables-in-angular-69dfd4136e21
π Code Link: https://gist.github.com/NetanelBasal/8abfd1dc1ce85bdc41ee0d9fd41d0781#file-css-var-4-ts
#angular #directive #css_variables
β Article Link: https://netbasal.com/binding-css-variables-in-angular-69dfd4136e21
Please open Telegram to view this post
VIEW IN TELEGRAM
π1
π RunOutsideAngular decorator
#angular #decorator #ngZone
β Article Link: https://emilgadzaev.medium.com/achive-better-angular-application-using-typescript-decorators-9e0eb01ad72d
#angular #decorator #ngZone
β Article Link: https://emilgadzaev.medium.com/achive-better-angular-application-using-typescript-decorators-9e0eb01ad72d
π1
π
#angular #pipe #errors
β Article Link: https://max-syniuk.medium.com/handle-angular-form-control-validation-errors-using-pure-pipe-7c3a874ce77
π Code Link:
- Pipe
https://gist.github.com/maksym-syniuk/c2a8bba5144e05e3edce19e81d998706#file-control-error-handler-pipe-ts
- Use case
https://gist.github.com/maksym-syniuk/972aaf537c9bffaf30d43a5ede380046#file-app-component-html
FormControl validation errors using pure pipe#angular #pipe #errors
β Article Link: https://max-syniuk.medium.com/handle-angular-form-control-validation-errors-using-pure-pipe-7c3a874ce77
- Pipe
https://gist.github.com/maksym-syniuk/c2a8bba5144e05e3edce19e81d998706#file-control-error-handler-pipe-ts
- Use case
https://gist.github.com/maksym-syniuk/972aaf537c9bffaf30d43a5ede380046#file-app-component-html
Please open Telegram to view this post
VIEW IN TELEGRAM
π Angular Utilities: call pipe
#angular #pipe
β Article Link: https://medium.com/@mikekucherov92/angular-utilities-call-pipe-23b6ada72b93
#angular #pipe
β Article Link: https://medium.com/@mikekucherov92/angular-utilities-call-pipe-23b6ada72b93
π Optimize
#angular #directive #ngFor
β Article Link: https://levelup.gitconnected.com/angular-optimize-ngfor-with-a-custom-directive-3e39504000cd
π Code Link:
https://gist.github.com/Sw3eks/b4aa3f6c0a0d8e17dab5f38e3840c67f#file-ngfor-trackby-directive-ts
https://gist.github.com/Sw3eks/af3f14190fe2bb962b1d38ad0f6c098e#file-ngfor-trackby-usage-html
https://gist.github.com/Sw3eks/d6ef46242fdee83d4e65da6a0e011e9e#file-ngfor-trackbyproperty-directive-ts
https://gist.github.com/Sw3eks/18b22674c54822806a9d23fa7215204d#file-ngfor-trackbyproperty-usage-html
*ngFor with a custom directive#angular #directive #ngFor
β Article Link: https://levelup.gitconnected.com/angular-optimize-ngfor-with-a-custom-directive-3e39504000cd
ngForTrackById directive:https://gist.github.com/Sw3eks/b4aa3f6c0a0d8e17dab5f38e3840c67f#file-ngfor-trackby-directive-ts
https://gist.github.com/Sw3eks/af3f14190fe2bb962b1d38ad0f6c098e#file-ngfor-trackby-usage-html
ngForTrackByProperty directive:https://gist.github.com/Sw3eks/d6ef46242fdee83d4e65da6a0e011e9e#file-ngfor-trackbyproperty-directive-ts
https://gist.github.com/Sw3eks/18b22674c54822806a9d23fa7215204d#file-ngfor-trackbyproperty-usage-html
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
π Angular custom webpack config in 3 steps:
#angular #webpack
β Article Link: https://netbasal.com/customize-webpack-configuration-in-your-angular-application-d09683f6bd22
#angular #webpack
β Article Link: https://netbasal.com/customize-webpack-configuration-in-your-angular-application-d09683f6bd22