Updated: 19/03/2017
this.form.controls['dept'].setValue(selected.id);
OLD:
For now we are forced to do a type cast:
(<Control>this.form.controls['dept']).updateValue(selected.id)
Not very elegant I agree. Hope this gets improved in future versions.
More Related Contents:
- Angular2 – Radio Button Binding
- Angular 2: Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’
- Angular 2 – large scale application forms’ handling
- Angular: composite ControlValueAccessor to implement nested form
- How to make ‘submit’ button disabled?
- How to use array of objects for controls in Reactive Forms
- Angular 4 Form FormArray Add a Button to add or delete a form input row
- What causes the “control.registerOnChange is not a function” error
- The definitive guide to form-based website authentication [closed]
- How to use in JSF page? Single form? Multiple forms? Nested forms?
- VBA: Using WithEvents on UserForms
- How to use EL with in id attribute of a JSF component
- How to prevent robots from automatically filling up a form?
- How is mime type of an uploaded file determined by browser?
- How to manage Angular2 “expression has changed after it was checked” exception when a component property depends on current datetime
- What’s the difference between “Request Payload” vs “Form Data” as seen in Chrome dev tools Network tab
- changing the language of error message in required field in html5 contact form
- Symfony2 Setting a default choice field selection
- HTML form with multiple hidden control elements of the same name
- Can you require two form fields to match with HTML5?
- Avoid Angular2 to systematically submit form on button click
- HTML5: Slider with two inputs possible?
- HTML slider with two inputs possible?
- How to open a new window on form submit
- TypeScript-‘s Angular Framework Error – “There is no directive with exportAs set to ngForm”
- Angular reactive Form error: Must supply a value for form control with name:
- How does Chrome detect Credit Card fields?
- Adding / Removing components on the fly
- What is the difference between component and directive?
- What is copyWith and how can I use it in Flutter and what are it’s use cases?