Is it posibble to bind index property of *ngFor directive of Angular to some attribute that isnt part of native html?
<ol class="carousel-indicator">
<li data-target="#myCarousel" data-slide-to="{{i}}" *ngFor="let item of items; let i = index></li>
</ol>
Please edit to:
<li *ngFor="let banner of banners,let i = index" data-target="#carousel" class="{{ (i == 0) ? 'active' : '' }}" attr.data-slide-to="{{i}}"></li>
* edit: attr.data-slide-to="{{i}}" => Success
Try this
data-slide-to -----> [attr.data-slide-to]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With