refactored example to add AngularJS