Skip to content

pjlamb12/angular-loaders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b39eb23 · Nov 14, 2023

History

83 Commits
Jun 26, 2020
Jun 14, 2023
Nov 14, 2023
Nov 14, 2023
Jun 14, 2023
Jun 14, 2023
Jun 14, 2023
Jun 14, 2023
Nov 14, 2023
Nov 14, 2023
Jun 14, 2023
Jun 18, 2023
Jun 14, 2023
Jun 14, 2023
Nov 14, 2023
Nov 14, 2023
Nov 14, 2023
Nov 14, 2023
Jun 16, 2023

Repository files navigation

ng-loaders Package

Install the package with the following command:

npm install ng-loaders

Setting the spinnerType

You can change the spinner that displays by setting the spinnerType input on the component. The color is changed by updating the --spinnerColor CSS variable.

Set the Default spinnerType

The library uses an InjectionToken to set the default spinnerType. This makes it so you don't have to provide the spinnerType input on every ngx-loader component. You can set the default spinnerType in your root module or root app component like so:

providers: [
	{
		provide: NG_LOADERS_CONFIG,
		useFactory: () => ({ spinnerType: 'rotating-dots' }),
	}
],

Styling the Loader

You can style the loader with a couple of CSS variables. The loader's color can be set with the --spinnerColor CSS variable. You can set the loader's overlay background color with the --spinnerOverlayColor CSS variable. You can set the loader's overlay opacity with the --spinnerOverlayOpacity CSS variable.