diff --git a/.travis.yml b/.travis.yml index ae7fea5..96eed31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: node_js sudo: required dist: trusty node_js: - - 'v8.9.1' + - 'v8.9.3' before_install: - export CHROME_BIN=/usr/bin/google-chrome - export DISPLAY=:99.0 diff --git a/.yo-rc.json b/.yo-rc.json index 58577bd..f58cb46 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -1,7 +1,7 @@ { "generator-angular2-library": { "promptValues": { - "gitRepositoryUrl": "https://github.com/username/repo" + "gitRepositoryUrl": "https://github.com/osahner/ngx-httpclient-busy" } } } \ No newline at end of file diff --git a/README.MD b/README.MD index 0878575..c5f1bfe 100644 --- a/README.MD +++ b/README.MD @@ -1,5 +1,7 @@ # ngx-httpclient-busy +[![Build Status](https://travis-ci.org/osahner/ngx-httpclient-busy.svg?branch=master)](https://travis-ci.org/osahner/ngx-httpclient-busy) + ## Installation To install this library, run: @@ -8,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 + +``` + ## License MIT © [Oliver Sahner](mailto:osahner@gmail.com) diff --git a/package-lock.json b/package-lock.json index f130523..ba320c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ngx-httpclient-busy", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 431db1b..037e8ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngx-httpclient-busy", - "version": "0.1.0", + "version": "0.1.1", "scripts": { "build": "gulp build", "build:watch": "gulp", @@ -16,7 +16,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/username/repo" + "url": "https://github.com/osahner/ngx-httpclient-busy" }, "author": { "name": "Oliver Sahner", diff --git a/playground/index.html b/playground/index.html index 09423d9..33a3d94 100644 --- a/playground/index.html +++ b/playground/index.html @@ -22,8 +22,8 @@ diff --git a/playground/index.ts b/playground/index.ts index 41d55ed..96a2b94 100644 --- a/playground/index.ts +++ b/playground/index.ts @@ -15,19 +15,18 @@ import { CounterService, HttpClientBusyInterceptor, HttpClientBusyModule } from @Component({ selector: 'app', - template: `FontAwesome: - -
- Alert: - - Alert (with class): - -
- + template: `Icon + +
+ + +
+ ` }) class AppComponent implements OnInit { @@ -44,7 +43,7 @@ class AppComponent implements OnInit { return Observable.throw('An error occurred'); }) .subscribe(() => { - console.log('longrunning done'); + console.log('longrunning request done'); }); this.http .put>('https://www.mocky.io/v2/5185415ba171ea3a00704eed?mocky-delay=100ms', { @@ -54,7 +53,7 @@ class AppComponent implements OnInit { return Observable.throw('An error occurred'); }) .subscribe(() => { - console.log('shortrunning done'); + console.log('shortrunning request done'); }); this.http @@ -62,11 +61,11 @@ class AppComponent implements OnInit { headers: new HttpHeaders().set('Accept', 'application/json') }) .catch((error: any) => { - console.log('error done'); + console.log('error request done'); return Observable.throw('An error occurred'); }) .subscribe(() => { - console.log('error done'); + console.log('never happens'); }); } diff --git a/src/http-client-busy.directive.ts b/src/http-client-busy.directive.ts index bc612c2..410a181 100644 --- a/src/http-client-busy.directive.ts +++ b/src/http-client-busy.directive.ts @@ -40,7 +40,7 @@ export class HttpClientBusyDirective implements OnInit, OnDestroy { } ngOnInit() { - this._renderer.addClass(this._el.nativeElement, 'http-client-busy'); + // this._renderer.addClass(this._el.nativeElement, 'http-client-busy'); this._httpClientBusyConfig.idle = this.httpClientBusy.idle || 'fade'; this._httpClientBusyConfig.busy = this.httpClientBusy.busy || ''; this._updateStatus(0); diff --git a/src/package.json b/src/package.json index af83934..f6a3781 100644 --- a/src/package.json +++ b/src/package.json @@ -1,9 +1,9 @@ { "name": "ngx-httpclient-busy", - "version": "0.1.0", + "version": "0.1.1", "repository": { "type": "git", - "url": "https://github.com/username/repo" + "url": "https://github.com/osahner/ngx-httpclient-busy" }, "author": { "name": "Oliver Sahner", @@ -14,14 +14,15 @@ ], "license": "MIT", "bugs": { - "url": "https://github.com/username/repo/issues" + "url": "https://github.com/osahner/ngx-httpclient-busy/issues" }, + "homepage": "https://github.com/osahner/ngx-httpclient-busy#readme", "main": "ngx-httpclient-busy.umd.js", "module": "ngx-httpclient-busy.js", "jsnext:main": "ngx-httpclient-busy.js", "typings": "ngx-httpclient-busy.d.ts", "peerDependencies": { - "@angular/core": "^4.0.0", + "@angular/core": "^4.2.4 || ^5.0.0", "rxjs": "^5.1.0", "zone.js": "^0.8.4" }