src/app/shared/components/inheritance.ts
Properties |
Methods |
constructor()
|
|
Defined in src/app/shared/components/inheritance.ts:14
|
| myMethod |
myMethod()
|
|
Inherited from
MotherComponent
|
|
Defined in
MotherComponent:20
|
|
Returns :
string
|
| myProp |
Type : string
|
|
Inherited from
MotherComponent
|
|
Defined in
MotherComponent:14
|
import { Component, Input } from '@angular/core';
@Component({ template: '' })
export abstract class MotherComponent {
abstract myProp: string;
constructor() {}
abstract myMethod(): string;
}
@Component({ template: '' })
export class SonComponent extends MotherComponent {
myProp: string;
constructor() {
super();
}
myMethod(): string {
return 'Implementation A';
}
}
@Component({ template: '' })
export class GrandsonComponent extends SonComponent {
constructor() {
super();
}
myMethod(): string {
return 'Implementation B';
}
}