Search code examples
angularjsng-class

Syntax of ng-class


I am assigning ng-class to an element using this.

ng-class="{'level-' + {{row.level}}:true,active:TestFlag==true}"

but it is giving me tons of errors. What is wrong with its syntax? What is the correct way of doing this?


Solution

  • use

    ng-class="{'level-{{row.level}}': true, active: TestFlag==true}"