Survey App rewrite in AngularJS