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.

Dynamic input[radio] doesn't remain checked with complex dynamic data #8014

@kemar

Description

@kemar

Hi there!

I'm building a dynamic list of radio inputs based on JSON data coming from an API.

I'm using ngRepeat + track by, input[radio] and ngValue to bind complex objects.

Any new XHR request will refresh the data in the $scope but the currently checked radio will be unchecked.

It turns out that AngularJS uses equality by reference to figure out which radio button gets checked.

Is there a reason for this? What is my best option here?

Full demo on Plunker: http://embed.plnkr.co/2q1A7krBzxIjkfwhXYcK/preview

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions