Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/f22hd/simple-ngx-loading-bar

A library that allows to a developer using loading bar indicator for getting better user expeirence.
https://github.com/f22hd/simple-ngx-loading-bar

angular angular-lib typescript

Last synced: 10 days ago
JSON representation

A library that allows to a developer using loading bar indicator for getting better user expeirence.

Awesome Lists containing this project

README

        

# SimpleLoadingBar

An angular library allows a developer to show the loading bar at the top of the app, such as indicating an Http request and showing the loading bar until request is finished.

#### About Library

it contains a single component that should be added into your parent component app or header app.
To make sure the loading bar will be on top of the app,
the component styled with an absolute position so always will be top and above on all elements.

### Installation

- run this command in your terminal

```
npm i simple-ngx-loading-bar
```

- import the module in your app module

```
import { SimpleNgxLoadingBarModule } from 'simple-ngx-loading-bar';
@NgModule({
declarations: [...],
imports: [
...,
SimpleNgxLoadingBarModule.forRoot({
color: 'red' // define your custom color by any background property value.
})
],
providers: [],
bootstrap: [...]
})
export class AppModule { }

```

- add the selector into your component html

```

```

- finally , we have it's service for controlling visiblity of the loading bar.

```
import { SimpleNgxLoadingBarService } from 'simple-ngx-loading-bar';

export class AppComponent {
constructor(private loader: SimpleNgxLoadingBarService) { }

start() {
// show loading indicator
this.loader.show();
}

complete() {
// hide loading indicator
this.loader.hide();
}

```

That's set.

### Contribution

I will be more than happy to join me in this project.
just open via codebase and do your magic then make pull request.