How do I disable ngAria in ngMaterial?

后端 未结 5 999
不知归路
不知归路 2021-01-07 17:43

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

Attribute \"

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-07 18:03

    I think Salal Aslam's answer is better, but if you want to disable the Aria warnings temporarily you could just do a tweak on the console.warn override you suggested in the original question. Something like this perhaps:

    console.realWarn = console.warn;
    console.warn = function (message) {
        if (message.indexOf("ARIA") == -1) {
            console.realWarn.apply(console, arguments);
        }
    };
    

    Edit: for complex situations, more elaborate solutions may be required. Check out Shaun Scovil's Angular Quiet Console

提交回复
热议问题