A guide to using AngularJS services and factories correctly.