1.0.0 • Published 5 years ago

an-loader v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Loader module for Angular6+ applications

Installation

Download from npm

npm install --save an-loader

Angular installation

In app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { AnLoaderModule } from 'an-loader';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    AnLoaderModule.forRoot(), // <-- import here, forRoot() is necessary
  ],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}

In app.component.html

<an-loader></an-loader>

In your component, first import

import { AnLoaderService } from 'an-loader';
constructor(private loaderService: AnLoaderService){}

Then anywhere in your component

this.loaderService.display(true); // <-- turn on loader
this.loaderService.display(false); // <-- turn off loader

Edit css

Main wrapper class z-index for .an-looader is 10000

.an-looader

Loader class

.an-looader-icon