Answer the question
In order to leave comments, you need to log in
How to bind form control state to ngrx selectors?
titleFormControl: new FormControl('Сюда хочу передать значение селектора и когда состояние редакса меняется, чтобы значение инпута этой форм котролы тоже менялось', [
Validators.required,
]),
courseInfoSuccess$ = createEffect(() =>
this.dataPersistence.fetch(CourseInfoActions.CourseInfoSuccess, {
run: (action, state) => {
this.courseInfoService.courseInfoForm.controls.idFormControl.setValue((action as any).payload.id)
this.courseInfoService.courseInfoForm.controls.titleFormControl.setValue((action as any).payload.title)
this.courseInfoService.courseInfoForm.controls.subTitleFormControl.setValue((action as any).payload.subTitle)
this.courseInfoService.courseInfoForm.controls.descriptionFormControl.setValue((action as any).payload.description)
},
onError: (action, error) => this.errorHandler(action, error)
})
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question