I'm struggling to figure out why the assignment of vm.Info variable isn't working as expected. Apologies for the unclear question.
vm.getUser = function(email) {
vm.Info = ''
authentication
.avvocatoByEmail(email)
.error(function(err){
return null;
}).success(function(data){
vm.data = { user : data };
vm.Info = $crypto.encrypt(vm.data.user[0].id + "." + vm.data.user[0].email, 'myKey');
console.log("Seems fine here: " + vm.Info);
});
console.log("Looks empty here: " + vm.Info);
}