Angular2 providers with useClass purpose


        Might be wondering what is the purpose the useClass construct as shown here
[{ provide: Logger, useClass: Logger }
This provides a way for Angular2 to find and use the proper class / providers. Think of it as a key / value matching approach. Some people uses mock logger service by specifying useClass : BetterLogger.

Comments

Popular posts from this blog

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

android build issue with version compatibility with agp and hilt : An exception occurred applying plugin request [id: 'com.google.dagger.hilt.android', version: '2.52']