This is the exercise in the Angularjs book pages 38 - 41