Sample code from AngularJS book