converted tutorial to an AngularJS application