Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
chore: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
osahner committed Dec 14, 2017
1 parent 69b8730 commit 932338a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 11 deletions.
33 changes: 33 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,39 @@ To install this library, run:
$ npm install ngx-httpclient-busy --save
```

and then from your Angular `AppModule`:

```typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { AppComponent } from './app.component';

import { CounterService, HttpClientBusyInterceptor, HttpClientBusyModule } from 'ngx-httpclient-busy';

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
HttpClientBusyModule.forRoot()
],
providers: [
CounterService,
{ provide: HTTP_INTERCEPTORS, useClass: HttpClientBusyInterceptor, multi: true }
],
bootstrap: [AppComponent]
})
export class AppModule { }
```

Simple Working Gear [FontAwesome](http://fontawesome.io/) Icon

```xml
<i aria-hidden="true" class="fa fa-cog fa-fw fa-2x fa-spin text-muted loading-spinner fade" httpClientBusy></i>
```

## License

MIT © [Oliver Sahner](mailto:[email protected])
23 changes: 12 additions & 11 deletions playground/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ import { CounterService, HttpClientBusyInterceptor, HttpClientBusyModule } from

@Component({
selector: 'app',
template: `Icon
<i aria-hidden="true" class="fa fa-cog fa-fw fa-2x fa-spin text-muted loading-spinner fade" httpClientBusy></i>
<br>
<div class="alert alert-info transition" role="alert" httpClientBusy>
httpClientBusy
</div>
<div class="alert alert-success transition" role="alert" [httpClientBusy]="{idle: 'alert-success', busy: 'alert-info'}">
httpClientBusy Config <code>idle: 'alert-success', busy: 'alert-info'</code>
</div>
<hr>
<button class="btn btn-outline-primary" (click)="ping()">Ping</button>
template: `Icon
<i aria-hidden="true" class="fa fa-cog fa-fw fa-2x fa-spin text-muted loading-spinner fade" httpClientBusy></i>
<br>
<div class="alert alert-info transition" role="alert" httpClientBusy>
httpClientBusy
</div>
<div class="alert alert-success transition" role="alert"
[httpClientBusy]="{idle: 'alert-success', busy: 'alert-info'}">
httpClientBusy Config <code>idle: 'alert-success', busy: 'alert-info'</code>
</div>
<hr>
<button class="btn btn-outline-primary" (click)="ping()">Ping</button>
`
})
class AppComponent implements OnInit {
Expand Down

0 comments on commit 932338a

Please sign in to comment.