Skip to content

Commit c4601eb

Browse files
authored
Docs: Defining FormObject validator with FormGroupOptions (#86)
1 parent 4ce1ba7 commit c4601eb

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docusaurus/docs/guides/validating-forms.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,16 @@ Validator object will be used only for `Attribute` and `HasMany` relationships.
2929
## Defining FormObject validator with `FormGroupOptions`
3030

3131
To validate a `FormStore` instance as a whole, a validator can be provided via `formGroupOptions` on `FormObject`.
32+
33+
This can be used for validating the `BelongsTo` relationships.
34+
35+
```ts title="user.form-object.ts"
36+
import { Validators } from '@angular/forms';
37+
...
38+
public formGroupOptions: FormGroupOptions = {
39+
validator: (form: FormStore) => {
40+
...
41+
},
42+
};
43+
...
44+
```

docusaurus/versioned_docs/version-9.0.0/guides/validating-forms.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,16 @@ Validator object will be used only for `Attribute` and `HasMany` relationships.
2929
## Defining FormObject validator with `FormGroupOptions`
3030

3131
To validate a `FormStore` instance as a whole, a validator can be provided via `formGroupOptions` on `FormObject`.
32+
33+
This can be used for validating the `BelongsTo` relationships.
34+
35+
```ts title="user.form-object.ts"
36+
import { Validators } from '@angular/forms';
37+
...
38+
public formGroupOptions: FormGroupOptions = {
39+
validator: (form: FormStore) => {
40+
...
41+
},
42+
};
43+
...
44+
```

0 commit comments

Comments
 (0)