@mckit/loader
v20.0.2
Published
The Loader library provides a service and components to manage and display loading states in your Angular application.
Readme
Loader
Functionality
The Loader library provides a service and components to manage and display loading states in your Angular application.
Services
MCLoaderService
This service is used to control the loading state of the application.
- isLoading: A signal that indicates whether the loading state is active.
- show(): Sets the loading state to true.
- hide(): Sets the loading state to false.
Resolvers
mcLoaderResolver
This resolver hides the loading state when a route is resolved.
Components
MCSpinnerFullScreenComponent
This component displays a full-screen spinner when the loading state is active.
- isLoading: Binds to the
isLoadingsignal fromMCLoaderService.
Usage
- Inject the MCLoaderService in your components or services to control the loading state.
import { MCLoaderService } from '@mckit/loader';
constructor(private loaderService: MCLoaderService) {}
someMethod() {
this.loaderService.show();
// Perform some action
this.loaderService.hide();
}- Use the MCSpinnerFullScreenComponent in your templates to display the loading spinner.
<mc-spinner-full-screen></mc-spinner-full-screen>