Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unbound version of bindAttr in emberjs handlebars template

In cases where binding isn't needed, we can use {{unbound someProperty}}, but is there a way to achieve the same effect with tag attributes? As I understand it, our only option is bindAttr such as:

<img {{bindAttr src="thumbpath"}} />

Assuming 100+ images on the screen, and a somewhat frequent re-rendering (of the entire layout- not just the images), would there be any performance benefit in an unbound version?

like image 715
Jed Avatar asked Apr 10 '12 15:04

Jed


1 Answers

Because Ember doesn't need to track unbound values, you can actually just do this:

<img src="{{unbound thumbpath}}" />

And yes, there are performance benefits to using unbound values.

like image 112
Dan Gebhardt Avatar answered Oct 02 '22 23:10

Dan Gebhardt