switching to AngularJS