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-required conflicts with ng-true-value #5164

Closed

Description

@albvalente

If I set ng-required="something" inside a checkbox, ng-true-value does not work.
This issues happenes with 1.2.x, not with 1.1.x

plunker here
http://plnkr.co/edit/qBLIKaH1XmyQrSN5Xkz0?p=preview

Activity

  1. ghost assigned on Dec 31, 2013
  2. matsko commented on May 7, 2014

    @matsko
    Contributor

    This should fix the issue: #7377

  3. added 2 commits that reference this issue on May 27, 2014
    7df9181
    154ee61
  4. added 3 commits that reference this issue on Jun 10, 2014
    7c7da3a
    960d32b
    c07d7ba
  5. tbosch commented on Aug 4, 2014

    @tbosch
    Contributor

    This is still not working, see this punker with current 1.3.x version (http://plnkr.co/edit/VUAVYLLchaq5bNwgseRp?p=preview)

    • unchecking any checkbox (with and without ng-true-value) results in the model to be set to undefined. However: An invalid input should not update the model at all!
    • the second checkbox which has an ng-true-value shows an required error on load although it is checked. Unchecking it resets the model as well (which is already wrong), but checking it again does not set the model value to the ng-true-value back.
  6. reopened this on Aug 4, 2014
  7. matsko commented on Aug 4, 2014

    @matsko
    Contributor

    I'll work on this today.

  8. Narretz commented on Sep 7, 2014

    @Narretz
    Contributor

    This still happens. The problem is that $isEmpty is called with the viewValue, and checkboxInputType's $isEmpty returns true when the viewValue is unequal to the trueValue, which will almost always be the case.

  9. Narretz commented on Sep 7, 2014

    @Narretz
    Contributor

    I have a fix for this. Will send PR later.

  10. assigned and unassigned on Sep 7, 2014
  11. added 4 commits that reference this issue on Sep 8, 2014
    d6d775f
    0bd4f6e
    1d47b0b
    ad86241
  12. added a commit that references this issue on Sep 10, 2014
    fb9b667
  13. added 3 commits that reference this issue on Nov 21, 2014
    c3ee664
    187654c
    8692f87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions