Message Boards

HTML 'class" attribute is not working in Angular portlet of Liferay DXP 7.0

Chirag Lakhamani, modified 2 Years ago.

HTML 'class" attribute is not working in Angular portlet of Liferay DXP 7.0

New Member Posts: 2 Join Date: 2/16/21 Recent Posts

I have created one liferay angular module in liferay DXP 7. I have followed this document and created it. I am facing some issues with an angular component. When I deployed my liferay-angular portlet in my local system, sometimes the simple class attribute 'class="className" ' is not working properly because js minification converts the ‘class’ attribute to some random characters as shown in the below image.

To fix that issue I applied the class attribute this way "[class.row]=true" and it is working well in my local system.

I have checked with different node and npm versions but every time I face the same issue.

My Current node version is 8.10.0

enter image description here

thumbnail
Olaf Kock, modified 2 Years ago.

RE: HTML 'class" attribute is not working in Angular portlet of Liferay DXP

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts

because js minification converts the ‘class’ attribute to some random characters as shown in the below image.

I can't see random characters.

Please provide full steps to reproduce - e.g. your code, the result (text preferred, no image), expectations etc.