New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@k-adam/ngx-loading-spinner

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@k-adam/ngx-loading-spinner

Angular 8+ loader spinner. It can be used with two simple methods, `.show()` and `.hide()`. An example can be found in the `/projects/spinner-test`.

  • 1.10.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ngx-loading-spinner

Angular 8+ loader spinner. It can be used with two simple methods, .show() and .hide(). An example can be found in the /projects/spinner-test.

Setup

Install library ( Angular 10+ ):

npm install @k-adam/ngx-loading-spinner --save

If you are using an older version of Angular x (8/9), then install it this way:

npm install @k-adam/ngx-loading-spinner@1.x --save

Import module to your applications main module:

import { NgxLoadingSpinnerModule } from '@k-adam/ngx-loading-spinner';

Import it in your NgModule:

imports: [ NgxLoadingSpinnerModule.forRoot() ]

Place the component somewhere in your root level component:

<ngx-loading-spinner></ngx-loading-spinner>

Use

Import NgxLoadingSpinnerService to the components where you want to control the spinner:

import { NgxLoadingSpinnerService } from '@k-adam/ngx-loading-spinner';

Inject dependency:

constructor(
    private spinnerService: NgxLoadingSpinnerService
) { }

Use show() and hide() method to control the loading spinner:

this.spinnerService.show();
// ...
this.spinnerService.hide();

Parameters

All the parameters are optional.

NameTypeDefaultDescription
timeoutnumber10000 msThe spinner will be hidden automatically after the given time
thresholdnumber500 msThe spinner will be visible only, if the time between calling show() and hide() is more than threshold
zIndexnumber100The z-index property of the spinner overlay element
loadingTextstringThe displayed text under the spinner
templatestringThe spinner can be replaced with HTML text

Example:

<ngx-loading-spinner
  [threshold]="250"
  [timeout]="20000"
  [loadingText]="'Loading...'"
></ngx-loading-spinner>

Keywords

FAQs

Package last updated on 02 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc