0
Good night have that function https://pastebin.com/mZB1KtnS if I give an Alert(date); inside the function (below the date) ok, but I invoke the function in the Undefined controller. How can I fix it? thank you
0
Good night have that function https://pastebin.com/mZB1KtnS if I give an Alert(date); inside the function (below the date) ok, but I invoke the function in the Undefined controller. How can I fix it? thank you
0
$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.
Browser other questions tagged angularjs
You are not signed in. Login or sign up in order to post.
Rodolfo I need to return the value date. How would I do it? If I put Return data, give the same error...
– Augusto Furlan
if you are going to use within $Scope is just treat within Success and assign to $Scope, if you are going to use for another $http call put inside the Success, that is, what you have to do will do inside the Success
– Rodolfo .Freire
How would I return the date? For I will invoke it within another function...
– Augusto Furlan