October 2017
Intermediate to advanced
370 pages
8h 57m
English
Next, we need to ensure that the carousel displays the correct slide. We've seen how to do this earlier: we just bind the [slide] attribute of the carousel to the currentImage property with [slide]="product.currentImage".
We also need to make sure that the highlighted preview thumbnail stays in sync with the carousel when the user swipes through images directly instead of tapping a thumbnail. We saw this earlier too:
on="slideChange:AMP.setState({product: {currentImage: event.index}})"
But we have an extra task this time: we need to update the color property as well as the current slide because changing slide changes the color too. We could set the color using event.index since it gives us a number ...
Read now
Unlock full access