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

ng-required conflicts with ng-true-value #5164

Closed
albvalente opened this issue Nov 27, 2013 · 5 comments
Closed

ng-required conflicts with ng-true-value #5164

albvalente opened this issue Nov 27, 2013 · 5 comments

Comments

@albvalente
Copy link

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

@matsko
Copy link
Contributor

matsko commented May 7, 2014

This should fix the issue: #7377

matsko added a commit to matsko/angular.js that referenced this issue May 27, 2014
matsko added a commit to matsko/angular.js that referenced this issue May 27, 2014
matsko added a commit to matsko/angular.js that referenced this issue Jun 10, 2014
matsko added a commit to matsko/angular.js that referenced this issue Jun 10, 2014
matsko added a commit to matsko/angular.js that referenced this issue Jun 10, 2014
@matsko matsko closed this as completed in e53554a Jun 13, 2014
@tbosch
Copy link
Contributor

tbosch commented Aug 4, 2014

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.

@matsko
Copy link
Contributor

matsko commented Aug 4, 2014

I'll work on this today.

@btford btford removed the gh: issue label Aug 20, 2014
@Narretz
Copy link
Contributor

Narretz commented Sep 7, 2014

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.

@Narretz
Copy link
Contributor

Narretz commented Sep 7, 2014

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

@Narretz Narretz assigned Narretz and unassigned matsko Sep 7, 2014
Narretz added a commit to Narretz/angular.js that referenced this issue Sep 8, 2014
Narretz added a commit to Narretz/angular.js that referenced this issue Sep 8, 2014
Narretz added a commit to Narretz/angular.js that referenced this issue Sep 9, 2014
Narretz added a commit to Narretz/angular.js that referenced this issue Sep 9, 2014
tbosch added a commit to tbosch/angular.js that referenced this issue Sep 10, 2014
@tbosch tbosch closed this as completed in 3e51b84 Sep 10, 2014
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Nov 21, 2014
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Nov 21, 2014
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Nov 23, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.