Example code of "Angular.js Cookbook"