我需要在选择中选择选项并在此之后检查复选框中的一些值。但问题是当我选择选择选项时,我无法选中复选框。我想问题在于“expect(element...”)
$scope.isChecked = function(id, matches){
angular.forEach(matches,function(match) {
if(match === id){
expect(element(by.id('check'+match)).getAttribute('checked')).toBeTrue();
}
});
$scope.calculatedValue = 'You selected number ' + id +" and have "+ matches;
};
试试这个。
$scope.isChecked = function(id, matches){
angular.forEach(matches,function(match) {
if(match.toString() === id){
console.log(match);
$scope.calculatedValue = 'You selected number ' + id +" and have "+ matches;
angular.element(document.getElementById('check' + match).checked = true);
}
});
};
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句