Select default option not working with Ionic Framework

Marco

I am using Ionic Framework.
I would like to enter the first option as the default, but doing it this way does not work.
What can I do?

<select ng-model="newSpesaAereo.valuta">
    <option ng-selected="selected">Euro</option>
    <option>Dollaro</option>
    <option>Dollaro canadese</option>
    <option>Sterlina</option>
</select>

enter image description here

If I analyze the page with Google Chrome Developer Utility I watch this.

enter image description here

If I edit this HTML and I delete the selected row, then Euro is visible.

Why is this happening?

Jamie Sutherland

You need to use ng-selected instead of just selected.

https://docs.angularjs.org/api/ng/directive/ngSelected

<select ng-model="newSpesaAereo.metodoPagamento">
  <option ng-selected="selected">Carta di credito</option>
  <option>Bancomat</option>
  <option>Contanti</option>
  <option>Altro</option>
</select>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Codeigniter in select option default value not working

From Dev

Default option in select is not working using AngularJS

From Dev

Default "All" option not working on ng-option select list

From Dev

Laravel: Form select not working with style / class when setting the default option

From Java

default select option as blank

From Dev

HTML <select> default option

From Dev

default setting for option select

From Dev

How to select first option in ionic 2 select. selected attribute not working

From Dev

validation for select option not working

From Dev

Laravel - Select - set Default option

From Dev

Laravel Option Select - Default Issue

From Dev

Laravel Option Select - Default Issue

From Dev

add default option to angularjs select

From Dev

change color of default option in select

From Dev

Jquery select option default option text

From Dev

Page Transition Not Working Ionic Framework

From Dev

Selecting a select option with jQuery not working

From Dev

HTML: Select Option styling not working

From Dev

jquery onchange select option not working

From Dev

HTML: Select Option styling not working

From Dev

select option not working laravel 5.4

From Dev

AngularJS : how to create select option and set default select option?

From Dev

Ember Select default value not working

From Dev

Angular default option selected attribute not working as expected

From Dev

Ionic Select Option doesn' retrieve the value of option through ng-for

From Java

Set default option in mat-select

From Dev

Rails form_for select default option

From Dev

Set default value of select to null option

From Dev

Yii2 dropdownList select default option

Related Related

HotTag

Archive