A
A
alehandroWEB2018-02-05 15:30:00
Angular
alehandroWEB, 2018-02-05 15:30:00

How to add class to element on click Angular 5?

There is a list:

<ul>
   <li></li>
   <li></li>
   <li></li>
</ul>

How to add class "active" to li element that is clicked?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Stroykin, 2018-02-05
@alehandroWEB

It can be like this - example

V
Vladimir, 2018-02-05
@Casufi

https://angular.io/api/common/NgClass

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question