I am hosting an Angular 2 app on firebase. I want to send a contact form as an email. Ideally my solution would use Nodej
Edit: I just saw that you are serving on Firebase, I will look into how that changes things.
How would I run server-side code in Firebase?
Angular 2 is client side, if you want to do make an API call w/ your secret you should probably be doing it server side, aka node.js or whatever your server is.
Because you have sendmail.js
as a script, consider serving your Angular 2 application with node.js and having an API endpoint with express, like /api/sendMail
that you can make an XHR/AJAX request to from your Angular 2 application.