Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable ngAria in ngMaterial?

Tags:

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)

like image 707
benshope Avatar asked Jun 05 '15 12:06

benshope


People also ask

What is Ng ARIA?

The ngAria module provides support for common ARIA attributes that convey state or semantic information about the application for users of assistive technologies, such as screen readers.

What is ARIA Angularjs?

Overview. The $aria service contains helper methods for applying common ARIA attributes to HTML directives. ngAria injects common accessibility attributes that tell assistive technologies when HTML elements are enabled, selected, hidden, and more.


1 Answers

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!)

like image 109
ZachB Avatar answered Oct 29 '22 04:10

ZachB