Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.form = this.fb.group({
- displayName: [user.displayName, Validators.required],
- profile: this.fb.group({
- gender: [user.profile.gender, Validators.required],
- birthday: [user.profile.birthday, Validators.required],
- place_of_birth: [user.profile.place_of_birth, Validators.required],
- place_of_residence: [user.profile.place_of_residence, Validators.required],
- about_me: [user.profile.about_me, Validators.required],
- interests: [user.profile.interests, Validators.required],
- sport: [user.profile.sport, Validators.required],
- highSchool: this.fb.array(educationFGs)
- })
- });
- this.educations.splice(index, 1);
- const educationFGs = this.educations.map(education => this.fb.group(education));
- const educationArray = this.fb.array(educationFGs);
- this.form.setControl('highSchool', educationArray);
- add() {
- const fa = this.form.get('profile.highSchool') as FormArray;
- fa.push(this.fb.group({
- name: '',
- date: ''
- }));
- }
- remove(index) {
- const fa = this.form.get('profile.highSchool') as FormArray;
- fa.removeAt(index);
- }
Add Comment
Please, Sign In to add comment