Created
July 16, 2012 23:35
-
-
Save patrick-steele-idem/3125854 to your computer and use it in GitHub Desktop.
"Logic-less" versus "More logic"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- "LOGIC-LESS": --> | |
{{#cartEmpty}} | |
<div> | |
Your shopping cart is empty! | |
</div> | |
{{/cartEmpty}} | |
{{#cartNotEmpty}} | |
<ul> | |
{{cartItems}} | |
<li> | |
{{> cartItem}} | |
</li> | |
{{//cartItems}} | |
</ul> | |
{{/cartNotEmpty}} | |
<!-- MORE LOGIC: --> | |
<div c:if="cart.isEmpty()"> | |
Your shopping cart is empty! | |
</div> | |
<ul c:if="!cart.isEmpty()"> | |
<li c:for="item in cart.getItems()"> | |
<c:include template="cartItem" data="item"/> | |
</li> | |
</ul> | |
<!-- EVEN MORE LOGIC: --> | |
<c:choose> | |
<div c:when="cart.isEmpty()"> | |
Your shopping cart is empty! | |
</div> | |
<ul c:otherwise=""> | |
<li c:for="item in cart.getItems()"> | |
<c:include template="cartItem" data="item"/> | |
</li> | |
</ul> | |
</c:choose> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment