Port the application to AngularJS