I have a for loop that print the content of an array. I would like one line to be highlighted.
The array is stored in my component.ts, as well as the line to highlight (but to simplify i'll fix it at 1)
I know this works:
<script src="//code.angularjs.org/snapshot/angular.min.js"></script>
<body ng-app="">
<div ng-style="{color: (1==1)?'aqua':'black'}">Sample Text</div>
</body>
And this print my array content in black properly
<div *ngFor="let i of this.getCode()"> {{i}} <br></div>
But when i try to have both it throws at runtime : Cannot find a differ supporting object
<div *ngFor="let i of this.getCode()" ngStyle="{color: (i==1) ? 'aqua' : 'black'}"> {{i}} <br></div>

this.getCode(), does not is an array. Please try to log it to the console and prove that it is an array.thisyou can direclty callgetCode()andgetLineSelected()