My AngularJs page
var postContactFn = function($http,data){
return $http.post("myfirstfile.php", data);
}
mainModule.factory('postContact',['$http',postContactFn]);
//In my controller
postContactFn(data).success(function(data, status) {
if(data){
console.log('success');
}
}
Php page MyFirstFile.php
<?php
$name = $_POST['inputUsername'];
if(!empty($name)){
--send mail
echo 'success'
}
Here the mail is been sent to my id but I'm not getting redirected back the controller. Instead it is showing success on my page.
Any suggestions would be appreciated.. Thank you