This media is not supported in your browser
VIEW IN TELEGRAM
π Angular carousel
#angular #ui_element
β Article link: https://medium.com/@su.ede.kovacs/angular-carousel-e6953aa38f77
π Code link: https://stackblitz.com/edit/angular-dy6ybx?file=src%2Fcarousel.component.ts
#angular #ui_element
β Article link: https://medium.com/@su.ede.kovacs/angular-carousel-e6953aa38f77
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯2
π Reusable Checkbox Input in Angular
#angular #ui_element #ControlValueAccessor
All we need to do is to use its selector inside our
π© > Angular v16
β Article link: https://blog.bitsrc.io/how-ive-created-reusable-checkbox-input-in-angular-16-5fd470f26104
#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
This media is not supported in your browser
VIEW IN TELEGRAM
π Resizable Columns in Angular Table
#angular #directive #ui_element
β Article link: https://levelup.gitconnected.com/how-to-create-resizable-columns-in-angular-scrollable-table-a-step-by-step-guide-5b8f766c1f60
π Code link: https://stackblitz.com/edit/angular-6x5egd?file=src%2Fapp%2Fdirectives%2Fcolumn-resize.directive.ts
#angular #directive #ui_element
β Article link: https://levelup.gitconnected.com/how-to-create-resizable-columns-in-angular-scrollable-table-a-step-by-step-guide-5b8f766c1f60
Please open Telegram to view this post
VIEW IN TELEGRAM
π1π₯1
π Deactivate Route Guards in Angular
#angular #guard #ui_element
β Article link
#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
β Article link
#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
β Article link
#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
β Article link
#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
#angular #rxjs #ui_element #infiniteScroll
β Article 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
β Article link
π Code link
#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
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
β Article link
#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 #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
Please open Telegram to view this post
VIEW IN TELEGRAM
π2
This media is not supported in your browser
VIEW IN TELEGRAM
#angular #animations #ui_element
β Article link |
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
π1