C
C
Coder3212017-01-27 21:48:22
Angular
Coder321, 2017-01-27 21:48:22

How to pass value to ngClass?

There is such a template.
<div [ngClass]="_bodyClass"></div>
On the first load, all classes are applied, but when the _bodyClass is further changed on the template, nothing happens, although if you do this,
<div [ngClass]="{'testClass':myVariable}"></div>
everything works. What is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Stroykin, 2017-01-27
@Coder321

Пример

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question