Fix Circular Dependency issue

https://www.notion.so/Fix-Circular-Dependency-issue-bc1a435aa1e043a791a73b044fe5e35d

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
@Injectable({
  providedIn: 'root',
})
export class AppService {
	
	constructor(
    private injector: Injector,
    // public status: StatusService, // do not do it if this leads to circular dependency issue
  ) { }

  // use below instead
  getStatusSerice() {
    return this.injector.get<StatusSerice>(StatusSerice);
  }
}
This post is licensed under CC BY 4.0 by the author.