Source code from the book AngularJS Services