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
π€ Create Reusable
#angular #ngTemplateOutlet #ui_element
The goal is to make a reusable component that can be shared across the app and is highly configurable by the parent component.
β Article Link:
https://medium.com/null-exception/building-angular-reusable-components-using-ng-template-ngtemplateoutlet-ngtemplateoutletcontext-f8813b67cd1f
π Code Link:
1. https://gist.github.com/vikas0sharma/ddff8060b8c2d9275eac75b009fdfbf1#file-data-table-component-ts
2. https://gist.github.com/vikas0sharma/8ceb9b1ecfd08fa710d802351ab5bcf5#file-data-table-component-html
3. https://gist.github.com/vikas0sharma/3ecfa0913dcb4e14e8b99f43fa915c94#file-employess-component-ts
4. https://gist.github.com/vikas0sharma/4b66b931499fc587ca09a15ff55a92ad#file-employees-component-html
DataTable Component#angular #ngTemplateOutlet #ui_element
The goal is to make a reusable component that can be shared across the app and is highly configurable by the parent component.
β Article Link:
https://medium.com/null-exception/building-angular-reusable-components-using-ng-template-ngtemplateoutlet-ngtemplateoutletcontext-f8813b67cd1f
1. https://gist.github.com/vikas0sharma/ddff8060b8c2d9275eac75b009fdfbf1#file-data-table-component-ts
2. https://gist.github.com/vikas0sharma/8ceb9b1ecfd08fa710d802351ab5bcf5#file-data-table-component-html
3. https://gist.github.com/vikas0sharma/3ecfa0913dcb4e14e8b99f43fa915c94#file-employess-component-ts
4. https://gist.github.com/vikas0sharma/4b66b931499fc587ca09a15ff55a92ad#file-employees-component-html
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
π1
π Implementing a masking strategy on
#angular #ui_element
β Article link: https://medium.com/@shahzadjavaidisb/implementing-a-masking-strategy-on-ngbdatepicker-angular-d47cada589f2
ngbDatePicker#angular #ui_element
β Article link: https://medium.com/@shahzadjavaidisb/implementing-a-masking-strategy-on-ngbdatepicker-angular-d47cada589f2
π Angular Simple Tabs
#angular #ContentChildren #ngTemplate #ui_element
β Article link: https://javascript.plainenglish.io/angular-template-powers-4-7ffc219d2db0
π Code link: https://stackblitz.com/edit/stackblitz-starters-4e6zq8?file=src%2Fmain.ts
#angular #ContentChildren #ngTemplate #ui_element
β Article link: https://javascript.plainenglish.io/angular-template-powers-4-7ffc219d2db0
Please open Telegram to view this post
VIEW IN TELEGRAM
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