Learning exercise for AngularJS