Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Default value with ng-options not working with same object values #10255

@natcohen

Description

@natcohen

Hello,

I have the following array (please note that the name and the code are the same...if they are not the same there is no issue):

$scope.currencies = [{code:'USD', name:'USD'}, {code:'EUR', name:'EUR'}];

When I want to put it in a select:

<select ng-model='myCurrency' ng-options='currency.code as currency.name for currency in currencies'>

I get the list I want but if I allocate a default value:

$scope.myCurrency = 'USD';

I don't have any pre-selection.

It seems to work on earlier versions (1.2...) I'm using angularjs 1.3.4.

Happy thanksgiving!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions