Using Jasmine, this lesson will look at testing an AngularJS service.
Hi Bernardo. Use a service when you want just one of that kind of thing throughout your application. Authentication is a good example of a service...there's only going to be one user logged into the browser that is running an AngularJS application.
A factory, though, can have multiple instances created. Watch the videos about models and you can see some of the examples of how data does and doesn't get shared for services, factories, providers, controllers, etc.