Advantages of Keeping Code in Services

Let's discuss some of the advantages of keeping this type of code in services rather than in components.

The rule of thumb: code that can be written without referring to a controller's scope should be written this way and should be placed in a service.