Reputation: 67
I need to add a class 'test1'
if the values in 'emp_code'
and 'emp'
is same.
I had tried with the code,
class="{{ emp_empcode == emp ? 'test1' : 'test2' }}"
I had tried with this and this
Any other way? Thanks a lot in advance.
Upvotes: 0
Views: 42
Reputation: 715
[class.test1]="emp_code == emp"
should definitively work. You can also take a look at https://toddmotto.com/ng-class-angular-classes for more varieties
Upvotes: 2