I am struggling to solve the circular dependency warning when building an angular 5 app.
I have read these two questions: the first and the second, but can't figure out the problem in my code and how to solve it.
here is the warning:
WARNING in Circular dependency detected:
src\pages\addresses\add-address\add-address.component.ngfactory.js -> src\pages\nav-bar\nav-bar.component.ngfactory.js -> src\pages\cart-panel\cart-panel.component.ngfactory.js -> src\pages\addresses\add-address\add-address.component.ngfactory.js
I am using the service-provider as a service that other components are using.
add-address.component.ts
import { ServiceProvider} from '../../../providers/service-provider';
import { AlertService } from '../../../providers/alert-provider';
nav-bar.component.ts
import { ServiceProvider} from '../../providers/service-provider';
import { AlertService } from '../../providers/alert-provider';
cart-panel-component.ts
import { ServiceProvider} from '../../providers/service-provider';