I have this code:
-
ng-true-value
only accepts strings so you'll need to use a workaround. This has been a feature request for some time. In the meantime, you can do this:
Create an ids
object in the controller like:
$scope.ids = {};
and change ng-model
to reference a key in that object. You can use the default true/false
checkbox values:
Then you can loop over the keys in ids
checking for true
.
Here is a fiddle
- 热议问题