angular-validator

Custom Validator Control Quantity in Reactive Forms

对着背影说爱祢 提交于 2019-12-20 05:43:09
问题 I had a hard time implementing a custom validation in my reactive forms in Angular. I need to control the quantity. The quantity should not be more than the available quantity. The problem how can i get the total of all the quantity if each row has subrows. How will i able to compute the total of subrows and compare it to its parent row where the available quantity is found. Here's my code below. Here's also the link to my code PLEASE CLICK THIS LINK customValidator(campo1: string) { return

Custom Validator Control Quantity in Reactive Forms

 ̄綄美尐妖づ 提交于 2019-12-02 06:46:24
I had a hard time implementing a custom validation in my reactive forms in Angular. I need to control the quantity. The quantity should not be more than the available quantity. The problem how can i get the total of all the quantity if each row has subrows. How will i able to compute the total of subrows and compare it to its parent row where the available quantity is found. Here's my code below. Here's also the link to my code PLEASE CLICK THIS LINK customValidator(campo1: string) { return (group: FormGroup): { [key: string]: any } => { const receive = group.controls[campo1]; //Change this