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

fix(input): make checkbox ngTrueValue work with required #8979

Closed
wants to merge 1 commit into from

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Sep 8, 2014

Fixes #5164

The viewValue in a checkbox is always set to false (by default). Comparing to the trueValue is therefore incorrect.

@Narretz Narretz force-pushed the fix-checkbox-required branch from 1d47b0b to ad86241 Compare September 9, 2014 18:18
@tbosch tbosch self-assigned this Sep 9, 2014
@tbosch
Copy link
Contributor

tbosch commented Sep 10, 2014

Hie @Narretz, I think we need a different PR:
Right now ctrl.$isEmpty is sometimes called with the view value and sometimes with the model value. The correct thing is to always call it with the model value. Then it is correct to compare with ngTrueValue for checkboxes.

@tbosch
Copy link
Contributor

tbosch commented Sep 10, 2014

Landed your tests with my changes to the implementation in master, 3e51b84

@tbosch tbosch closed this Sep 10, 2014
@Narretz
Copy link
Contributor Author

Narretz commented Sep 10, 2014

👍 :

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng-required conflicts with ng-true-value
3 participants