First pass at converting to AngularJS.