2016-11-02 7 views
-1

ここでは、チェックされた値がtrueの場合のみ必要です。現在、truefalseの両方が追加されています。配列内にhasOwnProperty()を使用する

angular.forEach($scope.usersDetails, function(value, key) { 
    if (value.hasOwnProperty('checked')) { 

    } 
}); 

答えて

0
angular.forEach($scope.usersDetails, function(value, key) { 

    if (value.hasOwnProperty('checked') && value.checked) 
    { 

    } 
}); 
関連する問題