if(this.datashare.selectedtableId!=null) {
console.log( "inside if condition");
let resp= this.http.get(this.global.apiUrl+"columns/"+this.datashare.selectedtableId);
resp.subscribe((data)=>this.users=data);
console.log(this.users);
this.count=this.users.length;
}
When I check the console, it displays all the API data as expected (console.log(data))
. However, when I try to retrieve and store the data in a local variable at the beginning of my component, it returns undefined.