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

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -