I have defined a service like this :
angular.module(\'myApp\').service(\'myService\', [ \'$rootScope\', ... ...
I want my service to be in
use factory instead of service, so that you can have some checking logic in your service
factory
service
angular.module('myApp').factory('myService', function () { if (newUser) { return { // your service implementation here } } return undefined; };