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.

Confusing Type Coercion with ng-value #15283

Closed
@jongunter

Description

@jongunter

What is the current behavior?
When a model value is null or undefined, a radio button <input> with ng-value="false" won't be shown as checked.

When the model value is "" or 0, a radio button <input> with ng-value="false" will be shown as checked.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
http://plnkr.co/edit/oY0YipxdTJtjjZDDCDDu?p=preview

What is the expected behavior?
I understand the intent here (need for a "blank" value), but if type coercion is going to happen, shouldn't we either go all in, or not do it at all? This "halfway" type coercion is confusing. There should be some sort of option for ng-value that lets you turn on/off strict type coercion.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions