Good day everyone, I have this problem where I can't put value from console to a variable correctly. When I try to run it, it gives an error like this but I successfully fetch the record user_id from login page to log page. I want to put the value correctly for my query but I can't. I hope you can help me.
Here's the code.
async loadUsers(){ return new Promise(resolve => { this.storage.get('storage_xxx').then((res) => { let body = { aksi: 'load_users', user_id: console.log(res.user_id) } this.accsPrvds.postData(body, 'proses_api.php').subscribe((res:any)=>{ for(let datas of res.result){ this.users.push(datas); } resolve(true); }); }); }); }
Use directly without console log
let body = { aksi: 'load_users', user_id: res.user_id } //If you still want print that then console.log(res.user_id);
2.1m questions
2.1m answers
60 comments
56.9k users