Converting to AngularJS for fun