I need to set a value onInit and disable this input. I tried something like this:
this.authenticationService.get().subscribe((user) =>
this.form.controls.recruiter.setValue(`${user.firstName} ${user.lastName}`).disable()
);
but have error that Property 'disable' does not exist on type 'void'.
But If I rewrite it separately like this:
this.authenticationService.get().subscribe((user) => {
this.form.controls.recruiter.setValue(`${user.firstName} ${user.lastName}`);
this.form.controls.recruiter.disable();
});
the error is gone. Can someone explain why so and maybe there would be a better way how to make it.