I am saving the checked data in array .. to database. How can we set the checkbox checked property , and show all the checekd item in edit mode of page.
Create a new function MultiLoad to load your checked arrays and remove unchecked arrays MultiLoad():Observable{ let params1 = new HttpParams(); this.myClonedArray.forEach(id => { params1 = params1.append('categoryId', id); }); console.log(params1.toString()) return this.httpclient.get("localhost:3000/Products/", { params: params1 }); } myClonedArray is the array which has checked values this.myClonedArray = Object.assign([], this.selectedItems); console.log('cloned', this.myClonedArray) selecteditems has the values checked like in this video . instead of using selecteditems directly, i am cloning it into new array - myClonedArray now simple this.MultiLoad().subscribe((res) => { this.selectedProduct = res; console.log('selected', this.selectedProduct) }) in template do : *ngFor="Product of selectedProduct" the items having CategoryId that you have marked checked will be iterated back . busted my brains for this, thought to help
Guys, anyone can help me to clear my confusion, 1. I don't want to get roles each and every time from DB to check each and every routes of each user. How do I handle this. 2. Do I need to send roles in each req from client... If so how to send securely. If not how to handle/check roles of user from node express js. I am using angular as front end. 3. User role based need to show or hide a table. So after login server should send user roles, where do I store locally (currently using local storage), or the concept of saving user roles in client itself is wrong. I am doing a new application, needs to be handle above all, please help any one tip would be great
This is the video I was looking for
Tq for ur video
Thanks a lot this was exactly what I was looking for!Cheers..
God bless you
Please add select all and remove all also...else is superb
Thank you, it worked for me, this was really helpful.
this helped me to solve one of my problem...thanks a lot Techie Ocean :)
tnx brother,i got what i want
Thanks, Very useful to new learner.
Tq bro drop down m check box ka login nhi samjh rha tha
Thanks a lot Bro
Thank u so much, sir. It helped me lot
Thanks bro
It working thanks a lot
Thank you buddy👍
Thanks man this helped 🙌
Thanks a lot!
Thanks
I am saving the checked data in array .. to database. How can we set the checkbox checked property , and show all the checekd item in edit mode of page.
Create a new function MultiLoad to load your checked arrays and remove unchecked arrays
MultiLoad():Observable{
let params1 = new HttpParams();
this.myClonedArray.forEach(id => {
params1 = params1.append('categoryId', id);
}); console.log(params1.toString())
return this.httpclient.get("localhost:3000/Products/", { params: params1 });
}
myClonedArray is the array which has checked values
this.myClonedArray = Object.assign([], this.selectedItems);
console.log('cloned', this.myClonedArray)
selecteditems has the values checked like in this video . instead of using selecteditems directly, i am cloning it into new array - myClonedArray
now simple
this.MultiLoad().subscribe((res) => {
this.selectedProduct = res;
console.log('selected', this.selectedProduct)
})
in template do : *ngFor="Product of selectedProduct"
the items having CategoryId that you have marked checked will be iterated back .
busted my brains for this, thought to help
thanks man
You have a funny voice, like!
how do we validate?
Guys, anyone can help me to clear my confusion,
1. I don't want to get roles each and every time from DB to check each and every routes of each user. How do I handle this.
2. Do I need to send roles in each req from client... If so how to send securely. If not how to handle/check roles of user from node express js. I am using angular as front end.
3. User role based need to show or hide a table. So after login server should send user roles, where do I store locally (currently using local storage), or the concept of saving user roles in client itself is wrong.
I am doing a new application, needs to be handle above all, please help any one tip would be great