userdata:any[];
this.auth.getapicall().subscribe(datareturn=>{
console.log(datareturn.message);
this.userdata=datareturn;
I am calling an api with get method and store its data in "datareturn". I have stored the result in array of userdata. if I console the userdata it returns the results but I am unable to understand that how to access the data inside userdata. Here is the console data snapshot....
Here is console result
{data: Array(1), pageinfo: {…}, message: "Success", submessage: "Success"}
data: Array(1)
0: {id: "5fd881a754315ca43cf4af48", account_id: "5fce31a454315ca43cf4af31", user_id: "5fce31a454315ca43cf4af32", name: "aamaadmi", is_custom: true, …}
length: 1
__proto__: Array(0)
message: "Success"
pageinfo: {page: 1, limit: 25, total_count: 1}
submessage: "Success"
__proto__: Object
this.userdata = datareturn.message?.data?