Комментарии:
Sir this.parentSelector=false ; की जगह आप this.patentSelector=isChecked ;भी कर सकते है क्या??
ОтветитьExcelent friend
ОтветитьThis is great and very helpful. How would this be done if the array was held as a Behavior subject? eg. food = new BehaviorSubject<any[]>([{ id: 1, select: false, name:'dumpling'}, { id: 2, select: false, name:'hamburger'}, { id: 1, select: false, name:'sandwich'} ]);
ОтветитьVery nice!
Ответитьhow would you create a method that allows you to select all of the checkboxes?
Ответить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 ?
Ответитьi dont know if you are gonna read my comment , but this video definetly helped me a lot, thank you
Ответить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. '<td><input type="checkbox" [(ngModel)]="n .select"/></td>'. No method needed, clicking the checkbox immediately changes the value of the 'selected' attribute
Ответить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
ОтветитьHello my [checked] is not recognizing it why do you think is this?
ОтветитьBut when you select item 1 2 and 3, Dose the parent checkbox is checked automatically?
Ответить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
Really Nice it helped in my project
Ответить