switching to AngularJs