Created
October 18, 2012 17:40
-
-
Save edimoldovan/3913623 to your computer and use it in GitHub Desktop.
Computed property in handlebars template
This file contains 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
This is the computed property, which depends on an image array, the product.images | |
smallImages: function() { | |
"use strict"; | |
var smalls = product.images.map(function(original){ | |
return original + "-small.png"; | |
}); | |
return smalls; | |
}.property('product.images').cacheable(), | |
What I need, is something like this in my template: | |
{{#each image in smallImages}} | |
<li class="small-image"> | |
<img src="{{image}}"/> | |
</li> | |
{{/each}} | |
But here that computed property looks undefined. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment