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

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -