Search code examples
wai-ariaangularjs-material

How do I disable ngAria in ngMaterial?


ngAria (an accessibility module) is adding an unnecessary bower import to my Angular Material project - and now it is throwing warnings:

Attribute " aria-label ", required for accessibility, is missing on node

I only added ngAria because it appeared necessary for ngMaterial. My app does not need screen-reader accessibility.

Anyways, how can I remove ngAria from ngMaterial? or at least disable all warnings.

EDIT: It seems the only easy way to disable ngAria's warnings is console.warn = function() {}; which will just turn off your browser's warnings (I do not recommend doing this, since it may hide warnings unrelated to aria)


Solution

  • Disabling messages globally is possible as of 1.1.0:

    app.config(function($mdAriaProvider) {
       // Globally disables all ARIA warnings.
       $mdAriaProvider.disableWarnings();
    });
    

    (But do note the discussion in other answers about aria labels being important for accessibility!)