$scope.lsCanasta = [ "p1", "p2", "p3", "p4", "p5" ]; if(($scope.lsCanasta).length>0){ $("#btcontratar").removeClass("bt-disabled"); $("#btcontratar").removeAttr("disabled"); }else{ $("#btcontratar").addClass("bt-disabled"); $("#btcontratar").attr("disabled", "disabled"); }