How can i use both: map & array in [ngClass] in angular 4?

Viewed 627

How can i use both: map & array in [ngClass] in angular 4?

For example:

[ngClass]="[{'some-class':whenAppears()}, someReturnedClass()]"

where someReturnedClass is:

someReturnedClass() {
  return 'someClassName'
}

i tried so: [ngClass]="[{'some-class':whenAppears()}, someReturnedClass()]"

and [ngClass]="[{'some-class':whenAppears()}]" class="someReturnedClass()"

and [ngClass]="{'some-class':whenAppears(), '{{someReturnedClass()}}':true}"

but first - gives me errors, second replaces classes, third won't work too :(

how to combine without changing current logic?

2 Answers
Related