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
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ”„ Microinteractions: The Secret of Great App Design 4/5

#ui #design

Visualize Input
Data input is one of the most important elements of any application. And micro-interactions turn this process into something special. You can use existing visual elements to deliver feedbackβ€”just add nice visual details.

βœ… Article link: https://uxplanet.org/microinteractions-the-secret-to-great-app-design-4cfe70fbaccf
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ”„ Microinteractions: The Secret of Great App Design 5/5

#ui #design

Call to Action
Microinteractions have the power to encourage users to actually interact. By bringing empathy in user experience, you have a better chances users will make a move. But make sure the visual cues and animations are appropriate for your users. And keep longevity in mind β€” will the microinteraction get annoying on the 100th use, or is it universally clear and unobtrusive?

βœ… Article link: https://uxplanet.org/microinteractions-the-secret-to-great-app-design-4cfe70fbaccf
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ“„ Reusable Checkbox Input in Angular

#angular #ui_element #ControlValueAccessor

All we need to do is to use its selector inside our <form> HTML element with FormGroup:

<app-checkbox-input 
formControlName="fullName"
label="Check by Full Name"
></app-checkbox-input>


🚩 > Angular v16

βœ… Article link: https://blog.bitsrc.io/how-ive-created-reusable-checkbox-input-in-angular-16-5fd470f26104
πŸ“„ Deactivate Route Guards in Angular

#angular #guard #ui_element

The CanDeactivate route guard in Angular is responsible for determining if a route can be deactivated. It is commonly used when you want to check if the user is allowed to leave a particular component or route, perhaps due to unsaved changes or other dynamic conditions.


βœ… Article link
πŸ”₯2
πŸ“„ 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
πŸ‘5
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ“„ Customizable Angular animations

#angular #animations #ui_element

...A component with customizable animations might look like this...


// collapse.ts

const closedStyle = style({
height: 0
});

const openStyle = style({
height: '*'
});

const timings = '{{duration}}ms linear';

const defOptions: AnimationOptions = {
params: {
duration: 300
}
};

export const collapse = trigger('collapse', [
transition(
':enter',
animation([closedStyle, animate(animateTimings, openStyle)]),
defaultOptions
),
transition(
':leave',
animation([openStyle, animate(animateTimings, closedStyle)]),
defaultOptions
),
]);


// 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
},
};
}
}


βœ… Article link
πŸ‘3❀1πŸ”₯1
πŸ“„Managing the Sticky Navigation: Angular, Tailwind, and RxJS

#angular #rxjs #tailwind #navbar #ui_element

Explanation:
β€” `public readonly isSticky$ = fromEvent(window, 'scroll').pipe(...):` This defines the isSticky$ observable using RxJS operators. It listens for scroll events on the window, maps them to the vertical scroll position (window.scrollY), filters out consecutive duplicate values, and then maps the scroll position to a boolean value indicating whether the scroll position is greater than 24 (assuming 24 is a threshold value for determining when the navigation bar should become sticky).

β€” `distinctUntilChanged()`: This operator filters out consecutive duplicate values emitted by the observable.

β€” `map((scrollTop: number) => scrollTop > 24)`: This operator maps the scroll position (scrollTop) to a boolean value, indicating whether the user has scrolled past a certain threshold (24 in this case).

β€” `(isSticky$ | async) === true`: This condition checks if the value emitted by the isSticky$ is true or not. Which makes it convenient since you don’t have to unsubscribe the observable.

β€” `sticky top-0 z-10 shadow-lg opacity-95 bg-white`: These classes from TailWind will help enhance the sticky experience when the users scroll down.


βœ… Article link
πŸ“„ Infinite Scroll Component in Angular

#angular #rxjs #ui_element #infiniteScroll

βœ… Article link 🎁 Code Link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ“„ Angular Animations Tutorial: Route Transitions

#angular #ui_element #provideRouter #provideAnimations

export const routeTransition = trigger(
'routeTransition', [
transition('* => *', [
query(':enter', [
style({
opacity: 0,
scale: 0.9
}),
], { optional: true }),
query(':leave', [
animate('0.2s', style({
opacity: 0,
scale: 0.9
}))
], { optional: true }),
query(':enter', [
animate('0.2s', style({
opacity: 1,
scale: 1
}))
], { optional: true })
])
])


    <app-nav></app-nav>
<div
[@routeTransition]="data"
style="display: contents"
>
<router-outlet></router-outlet>
</div>


βœ… Article link

🎁 Code link
Please open Telegram to view this post
VIEW IN TELEGRAM
❀1πŸ‘1
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ“„ AI writing assistant

#js #react #ui_element

....Imagine you’ve created an amazing AI writing assistant giving helpful suggestions for writing engaging stories....


βœ… Article link
This media is not supported in your browser
VIEW IN TELEGRAM
❀️ πŸ€“ Angular Animations Functions

#angular #animations #ui_element

Example explanation:

Triggers (trigger):
parentTrigger: Defines animations for the parent element.
childTrigger: Defines animations for the child elements.

States (state):
parentTrigger: Has the states start and end.
childTrigger: Has the states visible and hidden.

Styles (style):
Defines final and intermediate styles for different states and transitions.

Transitions (transition):
Defines how the animation should occur between states.

Animate (animate):
Defines the duration and timing function of the animations.

Keyframes (keyframes):|
Used in the transition from visible to hidden in the child elements to create detailed intermediate animations.

Group (group):
Used in the transition from start to end in parentTrigger to animate multiple properties in parallel.

Sequence (sequence):
Used in the transition from end to start in parentTrigger to animate multiple properties in sequence.

Query (query):
Used in the transition from hidden to visible in childTrigger to select and animate child elements.

Stagger (stagger):
Used with query to apply a delay between the animations of the child elements, creating a cascading effect.


βœ… Article link 🎁 Code Link
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘2
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ’œ πŸ†š Angular Animations: Animating Multiple Items in Parallel

#angular #animations #ui_element

βœ… Article link | 🎁 Code link
Please open Telegram to view this post
VIEW IN TELEGRAM
🚳 JavaScript Design Pattern: Builder

#js #patterns #ui_element

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