Your video helped me to realise there is an easier way to do this - just use two way data binding on the boolean value, e.g. ''. No method needed, clicking the checkbox immediately changes the value of the 'selected' attribute
This is great and very helpful. How would this be done if the array was held as a Behavior subject? eg. food = new BehaviorSubject([{ id: 1, select: false, name:'dumpling'}, { id: 2, select: false, name:'hamburger'}, { id: 1, select: false, name:'sandwich'} ]);
Hi man I'm trying to do the same thing but using a array enclosed on .model.ts . This code is not working "map operator is complaining" any hint? Thanks
This did not help at all. What do you set ngModel to ? How can you pass checkbox values directly to an array in the model without having to do event handling ?
Your video helped me to realise there is an easier way to do this - just use two way data binding on the boolean value, e.g. ''. No method needed, clicking the checkbox immediately changes the value of the 'selected' attribute
usually youtube coding doesn't work, but this worked perfectly. thnx
Glad it helped
Thank you this video helped me a lot..
Really Nice it helped in my project
Excelent friend
i dont know if you are gonna read my comment , but this video definetly helped me a lot, thank you
how would you create a method that allows you to select all of the checkboxes?
Very nice!
If i select all manually then this will fail, How to solve this?
Sir this.parentSelector=false ; की जगह आप this.patentSelector=isChecked ;भी कर सकते है क्या??
How to use check boxes as formarray's form control and how to set value of check boxes boxes based on presence of data in db
i've been struggling with this for two days, do you have a solution
This is great and very helpful. How would this be done if the array was held as a Behavior subject? eg. food = new BehaviorSubject([{ id: 1, select: false, name:'dumpling'}, { id: 2, select: false, name:'hamburger'}, { id: 1, select: false, name:'sandwich'} ]);
But when you select item 1 2 and 3, Dose the parent checkbox is checked automatically?
Not yet, but you can make one.
@@Samlama8848 How we can make that code?
Hi man
I'm trying to do the same thing but using a array enclosed on .model.ts . This code is not working "map operator is complaining" any hint?
Thanks
Make sure variable you used is Array.
Hello my [checked] is not recognizing it why do you think is this?
Make sure you add Form Module, if that not working then I recommend to download/clone GIT and try to run. Thanks
This did not help at all. What do you set ngModel to ? How can you pass checkbox values directly to an array in the model without having to do event handling ?