I know this question may sound duplicate, and I tried everything found in the stack thread unable to solve this problem, so please bear with me
So that you can reproduce the error, I provide you with all the code, I thought it was
Github repo
Problem
I get the following error:
Vendor analysis errors: ↵ Unable to create a circular dependency! InjectionToken_HTTP_INTERCEPTORS ("[ERROR →]"): in NgModule AppModule in./ AppModule @ -1 : -1
Script info (notes)
Note 1
File: response-interceptor.service.ts
Way: ./src/app/shared/interceptors/response-interceptor/
HTTPClient
, 401
, , .
, global-functions-services
, 'relogin'
2
: global-function.service.ts
: ./src/app/shared/services/helper-services/global-function/
, ...
PersonService
constructor(
public dialog: MatDialog,
private _personService: PersonService
) { }
PersonService import
, .
PersonService:
./src/app/shared/services/api-services/person/person.service.ts
import { IRequest } from './../../../interfaces/I-request';
import { environment } from 'environments/environment';
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map'
import 'rxjs/add/operator/toPromise';
import { Person } from 'app/shared/models/person';
import { RequestFactoryService, REQUEST_TYPES } from 'app/shared/factories/request-factory/request-factory.service';
@Injectable()
export class PersonService {
private _requestService: IRequest;
constructor(
_requestFactoryService: RequestFactoryService
) {
this._requestService = _requestFactoryService.getStorage(REQUEST_TYPES.HTTP);
}
public signup(record): Promise<Person> {
let url = environment.api + 'person/public/signup';
return this._requestService.post(url, record) as Promise<Person>;;
}
public authenticate(code: string, password: string): Promise<Person> {
let url = environment.api + 'auth/signin';
let postData = {
code: code,
password: password
}
return this._requestService.post(url, postData) as Promise<Person>;
}
}
, , 2 , , .
!