Last active
June 8, 2021 12:42
-
-
Save whisher/2c64aa521dd40dffe5c7e2cc10e2d377 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
@Input() error!: Required<ErrorDto> | null; | |
@Input() loading!: boolean; | |
@Input() data!: UserDto; | |
@Output() submitted = new EventEmitter<UserDto>(); | |
frm!: FormGroup; | |
ngOnInit(){ | |
this.createForm(); | |
if (this.data.userId) { | |
this.frm.setValue(this.data); | |
} | |
} | |
createForm() { | |
this.frm = this.fb.group({ | |
/* Start hidden */ | |
userId: [null], | |
/* End hidden */ | |
firstName: ['', Validators.required], | |
lastName: ['', Validators.required] | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment