AngularJs ng-disabled not working in IE 9 for any solution?

I have a problem with the ng-disabled AngularJs directive, its work is good in chrome, but it does not work in IE 9, any solution to get it to work will be appreciated.

main.html

<select kendo-drop-down-list k-data-text-field="'text'"
    k-option-label="'Select'" k-data-value-field="'id'"
    k-data-source="assessmentOptions" name="riskAssesLevelLookupCode"
    required id="riskAssesLevelLookupCode"
    maxlength="256"
    ng-attr-disabled="{{disableAssessmentType? 'disabled': ''}}"
    ng-model="riskAssessmentDTO.riskAssesLevelLookupCode"
></select>
+4
source share
1 answer

I am currently having the same issue with ng-disabled. Unfortunately, the only workaround I could think of was to control the logic ng-disabledin the controller. So in your case:

<select kendo-drop-down-list k-data-text-field="'text'"
    k-option-label="'Select'" k-data-value-field="'id'"
    k-data-source="assessmentOptions" name="riskAssesLevelLookupCode"
    Required id="riskAssesLevelLookupCode"
    maxlength="256"
    ng-attr-disabled="checkForDisabled()"
    ng-model="riskAssessmentDTO.riskAssesLevelLookupCode">
</select>

And in the controller:

checkForDisabled() {
    if(disableAssessmentType) {
       return "disabled";
    } else {
       return "";
    }
}

IE9. ng-click. false, , . - :

<button ng-click="callMethod()" ng-disabled="checkDisabled()">
  Click me if Im enabled
</button>

:

checkDisabled() {
   // Let say it disabled
   $scope.isDisabled = false; // set a global flag
   return false;
}

callMethod() {
   if($scope.isDisabled) {
        //disabled, do nothing maybe handle an error?
   } else {
        //functionality when it enabled
   }
}
+4

All Articles