Skip to content

Commit f8fc350

Browse files
author
VladimirAmiorkov
committed
chore: update 'reactive forms' demo to use the 'id' of the objects for 'valueField' as it is the only unique field of those objects
1 parent 880b708 commit f8fc350

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

demo-angular/src/app/examples/reactive-forms/reactive-forms-example.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<GridLayout rows="100, *" columns="*, *" [formGroup]="movieForm" class="yellow-grid">
55
<Label row="0" col="0" text="Pick a movie:" class="black-label label-center field-name-label"></Label>
66
<PickerField #picker row="0" col="1" formControlName="movie" hint="select a movie" padding="10" pickerTitle="Pick a movie"
7-
class="picker-field" modalClass="myModal" valueField="year" textField="name" [items]="pickerItems">
7+
class="picker-field" modalClass="myModal" valueField="id" textField="name" [items]="pickerItems">
88
<ng-template let-item="item">
99
<GridLayout rows="auto, *" columns="*, auto" class="yellow-grid">
1010
<Label [text]="item.name" colSpan="2" class="black-label item-template-top-label"></Label>

demo-angular/src/app/examples/reactive-forms/reactive-forms-example.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class ReactiveFormsExampleComponent implements OnInit {
2828
]);
2929

3030
this.movieForm = new FormGroup({
31-
movie: new FormControl(this.pickerItems.getItem(0).year, Validators.required),
31+
movie: new FormControl(this.pickerItems.getItem(0).id, Validators.required),
3232
});
3333
}
3434

0 commit comments

Comments
 (0)