I played with ngAria and ngDisabled in AngularJS using the example below . I changed the custom flags directive in the example to set ng-disabled = true in the controller, which additionally sets aria-disabled = true, as shown in plunker here.
<some-checkbox role="checkbox" ng-model="checked" ng-class="{active: checked}" ng-disabled="isDisabled" ng-click="toggleCheckbox()" aria-label="Custom Checkbox" show-attrs>
var app = angular.module('ngAria_ngModelExample', ['ngAria'])
.controller('formsController', function($scope){
$scope.checked = false;
$scope.isDisabled=true;
$scope.toggleCheckbox = function(){
$scope.checked = !$scope.checked;
}
})...
But with ng-disabled = true and aria-disabled = true, this does not disable "Custom Checkbox", as shown by the plunker output. According to the documentation here and a few examples in stackoverflow, the "disabled" attribute only works for buttons, input, and text area. For custom directives (like above) ngDisabled is the path. But this does not seem to work for the above example. Any help here is appreciated.
source
share