Check box not (un)checking propertly



I put simple check in function on check in my check box list:

$scope.pushNotificationChange = function(item) {
    var limit = 3;
    var length = Settings.getSize();
    var checkedcount=0
    for (var i=0; i<length; i++)
        checkedcount+=( Settings.get(i).checked)? 1 : 0
    if (checkedcount>=limit){
        alert("You can only select a maximum of "+limit+" checkboxes")
        Settings.get( = false;

Functions in services looks like

save: function() {
window.localStorage[‘interes’] = JSON.stringify(_settings);
$rootScope.$broadcast(‘interes.changed’, _settings);
// Get a settings val
get: function(k) {
return _settings[k];
// Set a settings val
set: function(k, v) {
_settings[k] = v;;

The problem is that line Settings.get( = false; want uncheck the item but if I put Settings.get( = false; it will uncheck the next item that is after the checked one…

Is there some prohibition that state of check can’t be changed on item where check is currently done ?


Could you put up a simple CodePen sample of that? It’s hard to understand and visualize without something to look at.

You could start by forking this :


I skipped part of the app where I’m working with check boxes for a time. The problem in example, is that HTML5 element is set to true value, and you can see that JSON output is correct written but there is missing visual check mark. The “Push Notification” is correctly checked and outputted in ng-repeat logic is not the same. I think that this is also problem in my case.

Do you know how can I solve this ?



Looks like you need to remove the ng-checked attribute from the ion-checkbox tag and it works just fine.


Thnx a lot, that was quite simple… anyway I don’t see purpose of this attribute in this example, it is a little bit confusing to use it in ng-repeate.