Slightly modified version of the GutHub example in O'Reilly AngularJS Book.