Good evening I have this function link if I give an alert; inside the function (below the date) ok, but if I invoke the function in the undefined controller. How can I solve? Thank you
Good evening I have this function link if I give an alert; inside the function (below the date) ok, but if I invoke the function in the undefined controller. How can I solve? Thank you
$scope.convertMd5 = function (string) { // retorna string em md5
return $http({
method: 'POST',
url: '../assets/php/client/Users.php',
data: {ref: 'convert-md5', str: string},
dataType: 'html',
});
}
$scope.convertMs5('aaaa').success(function (data) {
//o que quer fazer
});
$ http works async, what happens is that the sl variable has only been set but no value and fc returns before the $ http response.