AngularJS do migracji kątowej: prototyp fabryczny

abstract class AbsCard {

  abstract remoteId: number;
  abstract version: number;
  abstract name: string
  abstract stars: number;

  public initFromRemote(): void {
    this.remoteId = 0;
  }

  public print() {
    console.log(this);
  }

}

class Card extends AbsCard {

  public remoteId: number = 0;
  version: number = 0;
  name: string = '';
  stars: number = 0;
  
  public constructor() { 
    super();
    /* other creation logic can come here */
  }
}

let c = new Card();
c.print();
SAMER SAEID