Migration from EJS to AngularJS