I am trying to perform a GET request from my Angular app controller when the "Send" button is pressed, as follows:
var config = {
method: 'GET',
url: '/sendmail',
params: {
from: $scope.name,
email: $scope.email,
message: $scope.message
}
};
$http(config).then(function (res) {
console.log("this message is successfully printed!");
});
In my Node.js Express app, I have:
app.get('/sendmail', function (req, res) {
// This should print, but never does.
console.log("Got mail!");
});
Why do you think the Express function is not picking up the call, even though the Angular app is sending it?