我正在尝试删除jQuery代码并实现以下代码,如下所示:-
$('.abc').hide();
$('.abc').show();
在angular5中为:-
(<any>document.getElementsByClassName('abc'))[0]['style'].display = 'none';
(<any>document.getElementsByClassName('abc'))[0]['style'].display = 'block';
获取错误:-
ERROR TypeError: Cannot read property 'style' of undefined at ContaComponent.loadComponent
However, jQuery code is working fine but I want to remove jQuery dependency as above but getting error.