Created
August 30, 2021 10:18
-
-
Save janpauldahlke/9a88c23e99f324317b7114262e152770 to your computer and use it in GitHub Desktop.
careplan-editor.component.ts
This file contains 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
export class CareplanEditorComponent implements OnInit, OnChanges, OnDestroy { | |
@Input() carePlanId: string | null = null; | |
carePlanForm = this.fb.group<CarePlanFormValue>({ | |
//there are more, but those are relavant | |
start: [null, { | |
validators: [ | |
Validators.required | |
], | |
asyncValidators: [ | |
validateCarePlanDates(this.formName, this.carePlanId, this.carePlanService), | |
] | |
}], | |
end: [null, { | |
validators: [ | |
Validators.required, | |
], | |
asyncValidators: [ | |
// eslint-disable-next-line | |
validateCarePlanDates(this.formName, this.carePlanId, this.carePlanService), | |
] | |
}], | |
}); | |
//you asked about my constructor | |
constructor( | |
private query: CarePlanQuery, | |
private fb: FormBuilder, | |
private carePlanService: CarePlanService, | |
private carePlanQuery: CarePlanQuery, | |
public vc: ViewContainerRef, | |
public store: CarePlanStore, | |
private fm: AkitaNgFormsManager, | |
) { | |
if (!this.DialogViewContainerRef) { | |
this.DialogViewContainerRef = vc; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
and the validator itselft looks like this, for now