@@ -21,7 +21,7 @@ import { Observable, Subject } from 'rxjs/Rx';
2121
2222@Injectable ( )
2323export class HttpInterceptorService extends Http {
24- private pendingRequests = 0 ;
24+ private _pendingRequests = 0 ;
2525 private pendingRequestsStatus : Subject < boolean > = new Subject < boolean > ( ) ;
2626
2727 constructor ( backend : ConnectionBackend , defaultOptions : RequestOptions ) {
@@ -32,10 +32,14 @@ export class HttpInterceptorService extends Http {
3232 return this . pendingRequestsStatus ;
3333 }
3434
35+ get pendingRequests ( ) : number {
36+ return this . _pendingRequests ;
37+ }
38+
3539 request ( url : string | Request , options ?: RequestOptionsArgs ) : Observable < Response > {
36- this . pendingRequests ++ ;
40+ this . _pendingRequests ++ ;
3741
38- if ( 1 === this . pendingRequests ) {
42+ if ( 1 === this . _pendingRequests ) {
3943 this . pendingRequestsStatus . next ( true ) ;
4044 }
4145
@@ -47,9 +51,9 @@ export class HttpInterceptorService extends Http {
4751 return error ;
4852 } )
4953 . finally ( ( ) => {
50- this . pendingRequests -- ;
54+ this . _pendingRequests -- ;
5155
52- if ( 0 === this . pendingRequests ) {
56+ if ( 0 === this . _pendingRequests ) {
5357 this . pendingRequestsStatus . next ( false ) ;
5458 }
5559 } ) ;
0 commit comments