Skip to content

Commit

Permalink
chore: update 'reactive forms' demo to use the 'id' of the objects fo…
Browse files Browse the repository at this point in the history
…r 'valueField' as it is the only unique field of those objects
  • Loading branch information
VladimirAmiorkov committed Mar 5, 2019
1 parent 880b708 commit f8fc350
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<GridLayout rows="100, *" columns="*, *" [formGroup]="movieForm" class="yellow-grid">
<Label row="0" col="0" text="Pick a movie:" class="black-label label-center field-name-label"></Label>
<PickerField #picker row="0" col="1" formControlName="movie" hint="select a movie" padding="10" pickerTitle="Pick a movie"
class="picker-field" modalClass="myModal" valueField="year" textField="name" [items]="pickerItems">
class="picker-field" modalClass="myModal" valueField="id" textField="name" [items]="pickerItems">
<ng-template let-item="item">
<GridLayout rows="auto, *" columns="*, auto" class="yellow-grid">
<Label [text]="item.name" colSpan="2" class="black-label item-template-top-label"></Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class ReactiveFormsExampleComponent implements OnInit {
]);

this.movieForm = new FormGroup({
movie: new FormControl(this.pickerItems.getItem(0).year, Validators.required),
movie: new FormControl(this.pickerItems.getItem(0).id, Validators.required),
});
}

Expand Down

0 comments on commit f8fc350

Please sign in to comment.