Faça do serviço Singleton Angular
@Injectable({
providedIn: 'root',
})
export class ApiService {
}
Danylo Kostiuchenko
@Injectable({
providedIn: 'root',
})
export class ApiService {
}
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class UserService {
}
// NgModule providers array
@NgModule({
…
providers: [UserService],
…
})