October 2017
Intermediate to advanced
370 pages
8h 57m
English
We can implement a basic if...else expression like this:
(currentImage==0 ? 'show' : 'hide')
You will probably recognize this expression syntax--it's shorthand for if...else in a number of programming languages. It says "if currentImage equals 0 then evaluate to string show, otherwise evaluate to hide". This is a useful pattern for showing or hiding elements based on a state property.
For performance reasons, there are limitations to what is possible with amp-bind expressions; these include the following:
Read now
Unlock full access