Last active
September 10, 2020 14:40
-
-
Save v-skochko/7ae621ab8184668b798f595a86de6276 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // get control inside form group | |
| this.form.get('reminder').get('reminderDateTime').disable(); | |
| //disable nested form control by index | |
| for (let i = 0; i < this.PARENT.NESTED.length; i++) { | |
| this.dependentForm.at(i)['controls']['CONTROLNAME'].disable(); | |
| } | |
| // Remove and set validators to nested forms | |
| this.locationsForm.at(i).get('CONTROLNAME').clearValidators(); | |
| this.NESTEDFORM.at(i).get('CONTROLNAME').setValidators([Validators.required]); | |
| this.NESTEDFORM.at(i).get('CONTROLNAME').updateValueAndValidity(); | |
| // Subscribe to nested form field | |
| for (let index = 0; index < this.form.value.teachers.length; index++) { | |
| this.teachersForm.at(index).get('clientId').valueChanges.pipe( | |
| takeUntil(this._unsubscribeAll), | |
| debounceTime(100) | |
| ).subscribe(val => { | |
| this.newChangeDetected(val, index); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment