I've got public value cursorUrl
and method which checks if url exists and if it exists it assigns urlCursor='pointer'
if it doesn't exist it assigns urlCursor='text'
.
The method seems to work fine, however it assigns every item to urlCursor='pointer'
even though console log prints me that it should be
pointer
text
text
text
this is my method:
ngOnChanges(changes: any) {
let index = 0;
this.urlCursor =
this.checkUrl(changes.items.currentValue[0].redirectionViewUrl);
index++;
console.log(this.urlCursor);
}
and this is html:
<div class="items" #item(window:resize)="itemResizeHandler();" >
<app-item
*ngFor="let item of items"
class="item-element"
[ngStyle]="{'cursor': urlCursor}"
[dataMode]="item.dataMode"
[redirectionViewUrl]="item.redirectionViewUrl"
></app-item>
</div>
does anyone have idea why it's not binding properly?