i want to extend from one class but delete some property

Discussão em 'Angular' iniciado por Mor Bargig, Dezembro 5, 2024.

  1. Mor Bargig

    Mor Bargig Guest

    I have some class for crud API service class I want to extend it but spear few properties for exam this is my class

    class Parent {
    public propertyToKeep: any;
    public propertyToDelete: any;
    constructor() { }
    }


    this is the child class

    class Child extends Parent {
    constructor() {
    super();
    }
    }


    Another file where I don't want to see and get access to

    export class comeComponent {
    constructor(private child: Child) {
    this.child.propertyToKeep // work
    this.child.propertyToDelete // error and I can't even see it
    }
    }

    Continue reading...

Compartilhe esta Página