Angular Spinner is used to show spinner on UI.
$ npm install rk-angular-spinner
After installing the module:
- Register SpinnerModule
import { SpinnerModule } from 'rk-angular-spinner';
- In the component provide the Spinner Service dependency
import { SpinnerService } from 'rk-angular-spinner';
export class AppComponent {
constructor(private spinnerService: SpinnerService) {
}
- Toggle the loader using below two methods
this.spinnerService.showLoader();
this.spinnerService.hideLoader();
- Place html selector in your app.component.html
<app-rk-spinner text="Loader.."></app-rk-spinner>
- For more info please check the demo sample provided, which listens on http://localhost:4200
$ npm install $ npm start