ОШИБКА TypeError: Невозможно прочитать свойство 'style' из неопределенного ContaComponent.loadComponent в angular5 - PullRequest
0 голосов
/ 23 сентября 2018

Я пытаюсь удалить код 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.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...