Methods of shared angular libraries are not visible even if they should be

Viewed 139

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:

enter image description here

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):

enter image description here

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).

0 Answers
Related