Brijesh shah Brijesh shah - 6 months ago 37
AngularJS Question

how to inject a service on basis of condition in angular js?

There is two services in my angular app first service is for testing Demo API and second is for Live API. I want to inject those service on condition basis, how can I inject those service on condition basis.

Thanks in Advance..


You can find $Injector doc here:$injector

.controller('myCtrl', function($injector){
 var myService;
     myService = $injector.get('myService');