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

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

Closed
Narretz wants to merge 1 commit into
angular:masterfrom
Narretz:fix-checkbox-required
Closed

Narretz wants to merge 1 commit into
angular:masterfrom
Narretz:fix-checkbox-required

Conversation

@Narretz

@Narretz Narretz commented Sep 8, 2014

Copy link
Copy Markdown
Contributor

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

tbosch commented Sep 10, 2014

Copy link
Copy Markdown
Contributor

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

tbosch commented Sep 10, 2014

Copy link
Copy Markdown
Contributor

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

@tbosch tbosch closed this Sep 10, 2014
@Narretz

Narretz commented Sep 10, 2014

Copy link
Copy Markdown
Contributor Author

👍 :

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