Use [ngValue] instead of “value”:
<select [(ngModel)]="selected.isConnected" id="etat">
<option [ngValue]="0">Not connected</option>
<option [ngValue]="1">Connected</option>
</select>
Related Contents:
- Manually Set Value for FormBuilder Control
- Angular 2: Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’
- How to make ‘submit’ button disabled?
- angular2 submit form by pressing enter without submit button
- Angular2 – Radio Button Binding
- How to trigger Form Validators in Angular2
- What causes the “control.registerOnChange is not a function” error
- How to use formControlName and deal with nested formGroup?
- Input type number “only numeric value” validation
- Angular 4 remove required validator conditionally
- Angular 2: formGroup expects a FormGroup instance. Please pass one in
- How to append new FormGroup or FormControl to form
- The definitive guide to form-based website authentication [closed]
- What characters are allowed in an email address?
- Postman Chrome: What is the difference between form-data, x-www-form-urlencoded and raw
- Is it a good practice to use an empty URL for a HTML form’s action attribute? (action=””)
- What’s the difference between “Request Payload” vs “Form Data” as seen in Chrome dev tools Network tab
- TypeScript-‘s Angular Framework Error – “There is no directive with exportAs set to ngForm”
- When should I use GET or POST method? What’s the difference between them?
- What is the right way to POST multipart/form-data using curl?
- How can I check that a form field is prefilled correctly using capybara?
- input type=”text” vs input type=”search” in HTML5
- HTML5: Slider with two inputs possible?
- What is & used for
- How to write “Html.BeginForm” in Razor
- Avoid Angular2 to systematically submit form on button click
- What’s the best UI for entering date of birth? [closed]
- Preventing form resubmission
- Better Honeypot Implementation (Form Anti-Spam)
- How is mime type of an uploaded file determined by browser?
- Validate fields after user has left a field
- Multiple forms in a single page using flask and WTForms
- HTML slider with two inputs possible?
- Firefox keeps form data on reload
- How to get form values in Symfony2 controller
- Trigger validation of all fields in Angular Form submit
- changing the language of error message in required field in html5 contact form
- Mask for an Input to allow phone numbers?
- Angular reactive Form error: Must supply a value for form control with name:
- Symfony2 Setting a default choice field selection
- Can you require two form fields to match with HTML?
- Angular 2: Get Values of Multiple Checked Checkboxes
- Symfony2 invalid form without errors
- Simple AngularJS Form is undefined in Scope
- Angular2: Find out if FormControl has required validator?
- HTML required readonly input in form
- Is there a way to localize input type=”date” in HTML5
- Are form elements outside of a FORM tag semantic html5?
- Angular 4 Form Validators – minLength & maxLength does not work on field type number
- Adding text (just text!) to a form in Drupal 7 [closed]