I'm working with angularjs, I have a query to bring me a user by document number, I return a json with the data, what I need is to access the data idUsuario of that json object to inject it elsewhere, to give a console.log in the variable to which I assign the result of the query, shows this.
I have tried with vm.data.idUser, vm.data ["userID"], but it tells me that it is undefined, I work with javascript, what is the correct way to do it?.
this is the code
var vm = this;
vm.user = {};
vm.user = Usuarios.queryBydocuni({
query: data[i].documento //esta parte es para sacar el parámetro de consulta de otra parte
});
vm.id = vm.user["idUsuario"];
console.log(vm.id);
Thanks in advance for your help.