When should we use useExisting
provider instead of useClass
?
providers: [
{provide: Class1, useClass: Class1},
{provide: Class2, useExisting: Class2}]
REMARK: I have not found an exact question on SO. And for better indexing decided to create this specific one here, although I found this answers:
but would like to have more real examples
useExisting - create refrence to service example here
useClass - create new instance of service example here