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.

ng-options doesn't work well when using objects #1302

@coli

Description

@coli

http://jsfiddle.net/ADukg/658/

The example uses ng-options to provide 3 different objects which can be selected. All works until you switch to the next section then comes back. As the implementation uses object comparison, Angular can no longer match the current selected with the datasource.

Conceptually, ng-options should store the 3 selection objects (somewhere) and their lifespan is tied to the "data" object's scope, and not to the ng-options's proxyOptions lifespan.

Also, the comparison should be on a key, and not on the object, in this example, the key is proxyType, there currently is no way to provide the key field to ng-option while still using the object as the value.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions