Let's say I have a 3rd party Authentication service. I would like to mock it so that I can enter some random username and password to bypass authentication in development mode.
In AngularJs, I can use $provide.decorator to wrap the original service and override its functionalities (https://docs.angularjs.org/guide/decorators). Later I can run this decorated service in development mode, but in production environment, I still can use the original service since it has been intact.
How could I achieve that in Angular?
0 Replies