A simple Loader component for AngularJS 2 applications.
Installation and Usage
ES6 via npm
npm install @blinfo/loader
Add LoaderModule to your root module or shared module @NgModule:
@NgModule({
imports: [LoaderModule],
exports: [LoaderModule]
})
Use bl-loader selector in the html to display the loader:
<bl-loader [isVisible]="{expression}"></bl-loader>
The LoaderComponent takes three inputs:
- isVisible:boolean - default false
- message:string - default ""
- position:string - default fixed
Note: position accepts only two values 'fixed' or 'relative'
Position fixed blocks the complete page with an overlay Position relative allows you to have the loader consume only a fixed section of the page
<bl-loader
[isVisible]="true"
[message]="'Please wait'"
[position]="'fixed'">
</bl-loader>