MEAN Stack - Pass form from Angular to Express to be emailed by Nodemailer
Though the previous answer is accepted, I'd like to address the reason for the error.
Your contact.js
should've looked like
function process(req, res) { //handle request here}exports.process = process;
Reason for the error is in contact.js
you dont have post
method defined in exports
. So you cannot call it. what you want is the above code.
I recommend you to look into something like this. After you implement REST on express side, it's really simple to work with REST API using Restangular on AngularJs side.
Reasons for that transition are really simple, right now you are implementing your code too low level. Moving it on higher level allows you to escape reimplementing things that already in Restangular.