In my angular app i have two arrays arr1, arr2, where i am using arr1 to render button in my view using ngFor. I want to change the style of button by comparing the items of arr1 and arr2. if there is a match, i want to apply different styling. How can i implement this please guide me.
app.component.ts
arr1 = [{test:1}, {test:2}, {test:3}, {test:4}, {test:5}, {test:6}, {test:7}, {test:8}, {test:9}, {test:10}]
arr2 = [{test:5}, {test:9}]
appCopmponent.html
<div class="col-md-12">
<div class="form-row">
<div class="col-md-1" *ngFor="let data of arr1">
<input type="button" class="form-control" [(ngModel)]="data.test" readonly>
</div>
</div>
</div>
ngClassand/orngStyleare most likely to be suitable for your requirement. angularjswiki.com/angular/…