I have an Angular 11 application that uses some Angular libraries i wrote myself; some of them have dependencies among themselves, like in this picture:
ServiceA.ts (in bundle FeatureA):
import { Injectable } from '@angular/core';
@Injectable()
export class ServiceA {
constructor() { }
method1() {
return 'method1';
}
method2() {
return 'method2';
}
}
ServiceB.ts (in bundle FeatureB):
import { Injectable } from '@angular/core';
import { ServiceA } from '@my-lib/some-lib/src/lib/featureA';
@Injectable()
export class ServiceB extends ServiceA { // Here i extend ServiceA, to inherit method1 and method2
constructor() {
super();
}
method3() {
return 'method3';
}
metodo4() {
return 'method4';
}
}
However, when i try to use ServiceB inside my angular App, method1 and method2 are not visible (even if they are extended by the class):
Note: the architecture i used is described as sub-entry per feature (https://medium.com/@tomastrajan/the-best-way-to-architect-your-angular-libraries-87959301d3d3).

