migration to AngularJS