angular - Why use abstract class instead of interface if no methods are implemented -
angular2 in file core/src/metadata/lifecycle_hooks.ts
declares class abstract
export abstract class oninit { abstract ngoninit(): void; }
why not declare interface since doesn't have implementation?
interfaces don't exist in java-script; so, presumably, using abstract classes (that don't have member implementations) useful way have "contract" have real type @ run time. 1 possible use dependency injection.
Comments
Post a Comment