This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from '@angular/core'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; | |
import { RequestTimeoutHttpInterceptor, DEFAULT_TIMEOUT } from './interceptors'; | |
import { AppComponent } from './app.component'; | |
@NgModule({ | |
imports: [ | |
BrowserModule, | |
HttpClientModule, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http'; | |
import { empty, TimeoutError } from 'rxjs'; | |
import { timeout, catchError } from 'rxjs/operators'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class RequestTimeoutHttpInterceptor implements HttpInterceptor { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
cd /nginx | |
taskkill /f /IM nginx.exe | |
start nginx | |
exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
cd /nginx | |
taskkill /f /IM nginx.exe | |
exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { BehaviorSubject, Subscription, Observable } from 'rxjs'; | |
import { interval } 'rxjs/operators'; | |
@Injectable() | |
export class IntervalService { | |
private subject = new BehaviorSubject<number>(-1); | |
private subscription: Subscription; | |
readonly observable$ = this.subject.asObservable(); |
NewerOlder